#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int x[114514] = {};
  long long int y[114514] = {};
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> y[i];
  }
  long long int xs = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int a = (long long int)(i - 1) * x[i];
    a = a % 1000000007LL;
    long long int b = (long long int)(n - i) * x[i];
    b = b % 1000000007LL;
    xs += a - b;
    if (xs >= 1000000007LL) {
      xs = xs % 1000000007LL;
    }
  }
  long long int ys = 0;
  for (long long int i = 1; i <= m; i++) {
    long long int a = (long long int)(i - 1) * y[i];
    a = a % 1000000007LL;
    long long int b = (long long int)(m - i) * y[i];
    b = b % 1000000007LL;
    ys += a - b;
    if (ys >= 1000000007LL) {
      ys = ys % 1000000007LL;
    }
  }
  long long int ans = xs * ys;
  if (ans >= 1000000007LL) {
    ans = ans % 1000000007LL;
  }
  cout << ans << endl;
}
