#include <bits/stdc++.h>
using namespace std;
bool cmp(long long x, long long y) { return x > y; }
int main() {
  long long n, m, sum = 0, ans = 0;
  vector<long long> a(n), b(m);
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (long long i = 1; i <= m; i++) scanf("%lld", &b[i]);
  for (long long i = 1; i <= n; i++) {
    sum += a[i] * (n - i * 2 + 1);
    sum %= 1000000007;
  }
  for (long long i = 1; i <= m; i++)
    ans = (ans + b[i] * (m - i * 2 + 1) * sum) % 1000000007;
  printf("%lld", ans);
  return 0;
}
