#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int x[100005], y[100005];
long long dp[100005], cnt[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long X = 0, Y = 0;
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < n; i++) {
    int dis = x[i] - x[i - 1];
    cnt[i] = cnt[i - 1] + 1;
    dp[i] = dp[i - 1] + dis * 1ll * cnt[i];
  }
  for (int i = 0; i < n; i++) X = (X + dp[i]) % mod;
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < m; i++) {
    int dis = y[i] - y[i - 1];
    cnt[i] = cnt[i - 1] + 1;
    dp[i] = dp[i - 1] + dis * 1ll * cnt[i];
  }
  for (int i = 0; i < n; i++) Y = (Y + dp[i]) % mod;
  printf("%lld\n", X * 1ll * Y % mod);
}
