#include <bits/stdc++.h>
using namespace std;
long long sum1 = 0, sum2 = 0;
long long x, y;
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    sum1 += (2 * i - 1 - n) * x % 100000007;
  }
  for (int i = 1; i <= m; i++) {
    cin >> y;
    sum2 += (2 * i - 1 - m) * y % 100000007;
  }
  cout << sum1 * sum2 % 1000000007 << endl;
  return 0;
}
