#include <bits/stdc++.h>
using namespace std;
long long int x[100000], y[100000];
long long int gu(int n, int w) {
  long long int ret = 0, tmp = n - 1;
  for (int i = (n / 2) - abs(n / 2 - w); i > 0; i--) {
    ret += tmp;
    tmp -= 2;
  }
  return ret;
}
long long int ki(int n, int w) {
  long long int ret = 0, tmp = n - 1;
  for (int i = (int)(n / 2) - (fabsf((float)(n / 2) - w) - (float)0.5); i > 0;
       i--) {
    ret += tmp;
    tmp -= 2;
  }
  return ret;
}
int main() {
  int n, m;
  long long int ans = 0;
  cin >> m >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> y[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      long long int kei = 1;
      if (n % 2 == 0) {
        kei *= gu(n, i);
      } else {
        kei *= ki(n, i);
      }
      if (m % 2 == 0) {
        kei *= gu(m, j);
      } else {
        kei *= gu(m, j);
      }
      ans += (x[i] - x[i - 1]) * (y[j] - y[j - 1]) * kei;
      ans = ans % (long long int)(pow(10, 9) + 7);
    }
  }
  cout << ans << endl;
  return 0;
}
