#include <bits/stdc++.h>
int n;
int m;
long long int x[100001];
long long int y[100001];
long long int ans;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &y[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int k = 1; k <= m; k++) {
        for (int l = k + 1; l <= m; l++) {
          ans += (x[j] - x[i]) * (y[l] - y[k]);
          ans %= 1000000007;
        }
      }
    }
  }
  printf("%lld\n", ans);
}
