output_description: Print the total area of the rectangles, modulo 10^9+7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n m
      x_1 x_2 ... x_n
      y_1 y_2 ... y_m
attempt: # -*- coding: utf-8 -*-
  
  import sys
  from itertools import accumulate
  
  
  def input():
      return sys.stdin.readline().strip()
  
  
  def list2d(a, b, c):
      return [[c] * b for i in range(a)]
  
  
  def list3d(a, b, c, d):
      return [[[d] * c for j in range(b)] for i in range(a)]
  
  
  def list4d(a, b, c, d, e):
      return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
  
  
  def ceil(x, y=1):
      return int(-(-x // y))
  
  
  def INT():
      return int(input())
  
  
  def MAP():
      return map(int, input().split())
  
  
  def LIST(N=None):
      return list(MAP()) if N is None else [INT() for i in range(N)]
  
  
  def Yes():
      print("Yes")
  
  
  def No():
      print("No")
  
  
  def YES():
      print("YES")
  
  
  def NO():
      print("NO")
  
  
  sys.setrecursionlimit(10**9)
  INF = 10**18
  MOD = 10**9 + 7
  
  N, M = MAP()
  A = LIST()
  B = LIST()
  
  # データの持ち方を座標から区間長にして累積和
  A2 = []
  for i in range(N - 1):
      A2.append(A[i + 1] - A[i])
  B2 = []
  for i in range(M - 1):
      B2.append(B[i + 1] - B[i])
  A2 = [0] + list(accumulate(A2))
  B2 = [0] + list(accumulate(B2))
  
  # 縦横独立に、累積和の全区間総和を取る
  lsm = rsm = 0
  for i in range(N):
      lsm += A2[i] * (N - i - 1)
      rsm += A2[i] * i
      lsm %= MOD
      rsm %= MOD
  h = rsm - lsm
  lsm = rsm = 0
  for i in range(M):
      lsm += B2[i] * (M - i - 1)
      rsm += B2[i] * i
      lsm %= MOD
      rsm %= MOD
  w = rsm - lsm
  
  ans = h * w % MOD
  print(ans)
  
problem_description: Statement
  
  On a two-dimensional plane, there are m lines drawn parallel to the x axis,
  and n lines drawn parallel to the y axis. Among the lines parallel to the x
  axis, the i-th from the bottom is represented by y = y_i. Similarly, among the
  lines parallel to the y axis, the i-th from the left is represented by x =
  x_i.
  
  For every rectangle that is formed by these lines, find its area, and print
  the total area modulo 10^9+7.
  
  That is, for every quadruple (i,j,k,l) satisfying 1\leq i < j\leq n and 1\leq
  k < l\leq m, find the area of the rectangle formed by the lines x=x_i, x=x_j,
  y=y_k and y=y_l, and print the sum of these areas modulo 10^9+7.
samples: [{"input": "3 3\n    1 3 4\n    1 3 6", "output": "60\n    \n\nThe following figure illustrates this input:\n\n![sample1-1](https://atcoder.jp/img/arc071/aec4d5cc2e5c73dbee455be237a649a5.png)\n\nThe total area of the nine rectangles A, B, ..., I shown in the following\nfigure, is 60.\n\n![sample1-2](https://atcoder.jp/img/arc071/f0771c0f7e68af2b00e7513186f585ff.png)\n\n* * *"}, {"input": "6 5\n    -790013317 -192321079 95834122 418379342 586260100 802780784\n    -253230108 193944314 363756450 712662868 735867677", "output": "835067060"}]