#include <bits/stdc++.h>
using namespace std;
int n, m;
long long int x[100005], y[100005];
long long int M = 1000000007;
long long int C(long long int j, long long int m) {
  return (long long int)(j * (m - j + 1)) % M;
}
int main(void) {
  cin >> n >> m;
  long long int tmp;
  for (int i = 1; i <= n; i++) {
    cin >> tmp;
    x[i] = tmp;
  }
  for (int j = 1; j <= m; j++) {
    cin >> tmp;
    y[j] = tmp;
  }
  long long int ans1 = 0;
  for (int i = 2; i <= n; i++) {
    ans1 += (x[i] - x[i - 1]) * C(i - 1, n - 1) % M;
    ans1 %= M;
  }
  long long int ans2 = 0;
  for (int j = 2; j <= m; j++) {
    ans2 += (y[j] - y[j - 1]) * C(j - 1, m - 1) % M;
    ans2 %= M;
  }
  long long int ans = ans1 * ans2 % M;
  system("pause");
  return 0;
}
