#Lutece3380. Yet Another Sum Problem

Yet Another Sum Problem

Description

Given an integer array ss whose length is nn and an integer array tt whose length is mm. Calculate

$$\sum_{i=1}^n\sum_{j=1}^m\sum_{k=1}^n\sum_{l=1}^m \max\{(s_i+t_j)-(s_k+t_l)+1,0\} $$

Input

The first line contains two integers n,mn,m (1n,m1061\le n,m\le 10^6).

The second line contains nn integers s1,s2,,sns_1,s_2,\ldots,s_n (1si1071\le s_i\le 10^7).

The third line contains mm integers t1,t2,,tmt_1,t_2,\ldots,t_m (1tj1071\le t_j\le 10^7).

It's guaranteed that i=1nsi107\sum_{i=1}^n s_i\le 10^7 and j=1mtj107\sum_{j=1}^m t_j\le 10^7.

Output

Output one integer indicating the answer. Please output the answer modulo 109+710^9+7.

Samples

3 3
1 1 3
1 2 3
106

Resources

The 22nd UESTC Programming Contest Preliminary