#include <bits/stdc++.h>
using namespace std;
struct Comb {
  vector<vector<int64_t> > data;
  Comb(int n) {
    data = vector<vector<int64_t> >(n + 1, vector<int64_t>(n + 1, 1));
    for (register int i = (1); i <= ((int)n); i++) {
      for (register int j = (0); j <= ((int)(i + 1) - 1); j++) {
        if (!j || j == i)
          data[i][j] = 1;
        else
          data[i][j] = data[i - 1][j - 1] + data[i - 1][j];
      }
    }
  }
  int64_t ncr(int n, int r) { return data[n][r]; }
};
int int_less(const void *a, const void *b) {
  return (*((const int *)a) - *((const int *)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int *)b) - *((const int *)a));
}
char input[3000000];
char *ptr = input;
void init() {
  size_t read_byte = fread(input, 1, 3000000 - 1, stdin);
  assert(read_byte);
  assert(read_byte < 3000000 - 2);
}
int ri() {
  int r = 0, s = 0;
  for (;;) {
    assert(*ptr);
    if (*ptr == '-') {
      s = 1;
      break;
    }
    if (*ptr <= '9' && *ptr >= '0') {
      r = *ptr - '0';
      break;
    }
    ptr++;
  }
  ptr++;
  for (;;) {
    if (*ptr < '0' || *ptr > '9') break;
    r = r * 10 + *ptr - '0';
    ptr++;
  }
  ptr++;
  if (s) r = -r;
  return r;
}
int main() {
  init();
  int n = ri();
  int m = ri();
  int nn = 0;
  int mm = 0;
  int last = ri();
  for (register int i = (0); i <= ((int)(n - 1) - 1); i++) {
    int a = ri();
    nn += ((int64_t)a - last) * (n - i - 1) % 1000000007 * (i + 1) % 1000000007;
    nn %= 1000000007;
    last = a;
  }
  last = ri();
  for (register int i = (0); i <= ((int)(m - 1) - 1); i++) {
    int a = ri();
    mm += ((int64_t)a - last) * (m - i - 1) % 1000000007 * (i + 1) % 1000000007;
    mm %= 1000000007;
    last = a;
  }
  cout << (((int64_t)nn) * mm % 1000000007) << endl;
  return 0;
}
