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