#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
int main(void) {
  long long MOD = 1000000007;
  int n, m;
  std::vector<int> x;
  std::vector<int> y;
  cout << "x y defined" << endl;
  cin >> n >> m;
  int m1;
  for (int i = 0; i < n; i++) {
    scanf("%d", &m1);
    x.push_back(m1);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &m1);
    y.push_back(m1);
  }
  long long field[100010][100010] = {};
  long long fieldmake_x[100010] = {};
  long long fieldmake_y[100010] = {};
  int addnum = n - 1;
  for (int i = 1; i <= n - 1; i++) {
    fieldmake_x[i] = fieldmake_x[i - 1] + addnum;
    addnum -= 2;
  }
  addnum = m - 1;
  for (int i = 1; i <= m - 1; i++) {
    fieldmake_y[i] = fieldmake_y[i - 1] + addnum;
    addnum -= 2;
  }
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 1; j <= m - 1; j++) {
      field[i][j] = fieldmake_x[i] * fieldmake_y[j];
    }
  }
  long long answer[100010][100010];
  long long grid;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 1; j <= m - 1; j++) {
      grid = (x[i] - x[i - 1]) * (y[j] - y[j - 1]);
      answer[i][j] = field[i][j] * grid;
      answer[i][j] %= MOD;
    }
  }
  long long finalanswer = 0;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 1; j <= m - 1; j++) {
      finalanswer += answer[i][j];
      finalanswer %= MOD;
    }
  }
  cout << finalanswer << endl;
  return 0;
}
