#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = long long(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long n, m;
vector<long long> x, y;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    x.push_back(temp);
  }
  for (int i = 0; i < m; i++) {
    long long temp;
    cin >> temp;
    y.push_back(temp);
  }
  long long xle = x[n - 1] - x[0];
  long long yle = 0;
  for (int i = 1; i < m; i++) {
    yle += (y[i] - y[i - 1]) * i * (m - i);
    yle %= MOD;
  }
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    ans += (x[i] - x[i - 1]) * i * (n - i) * yle;
    ans %= MOD;
  }
  cout << ans << "\n";
}
