#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+9 + 7;
long long n, m, l;
string s, t;
long long d[100], dp[500][500];
long long x[100000], y[100000];
char field[100][100];
int main() {
  long long p = 0;
  cin >> n >> m;
  for (long long i = (0); i < (n); i++) cin >> x[i];
  for (long long i = (0); i < (m); i++) cin >> y[i];
  for (long long i = (0); i < (n); i++) {
    for (long long j = (0); j < (m); j++) {
      for (long long k = (i + 1); k < (n); k++) {
        for (long long h = (j + 1); h < (m); h++) {
          p += (abs(x[i] - x[k]) * abs(y[j] - y[h])) % INF;
        }
      }
    }
  }
  cout << (p % INF) << endl;
  return 0;
}
