#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
double pi = 3.141592653589793;
signed main() {
  long long n, m;
  cin >> n >> m;
  long long a[114514], b[114514];
  long long suma[114514], sumb[114514];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (i)
      suma[i] = (a[i] + suma[i - 1]) % 1000000007;
    else
      suma[i] = a[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
    if (i)
      sumb[i] = (b[i] + sumb[i - 1]) % 1000000007;
    else
      sumb[i] = b[i];
  }
  long long ansh = 0, answ = 0;
  for (long long i = 1; i < n; i++) {
    ansh += ((i * a[i] % 1000000007) - suma[i - 1] + 1000000007) % 1000000007;
  }
  for (long long i = 1; i < m; i++)
    answ += ((i * b[i] % 1000000007) - sumb[i - 1] + 1000000007) % 1000000007;
  cout << ansh * answ % 1000000007 << endl;
  return 0;
}
