#include <bits/stdc++.h>
int abs(int x) { return x < 0 ? -x : x; }
int main(void) {
  int num_v, num_h;
  int v_lines[100000];
  int h_lines[100000];
  if (scanf("%d %d", &num_v, &num_h) != 2) {
    puts("num_v and num_h input error.");
    return 1;
  }
  for (int i = 0; i < num_v; i++) {
    if (scanf("%d", v_lines + i) != 1) {
      puts("v_lines input error.");
      return 1;
    }
  }
  for (int i = 0; i < num_h; i++) {
    if (scanf("%d", h_lines + i) != 1) {
      puts("h_lines input error.");
      return 1;
    }
  }
  long long unsigned sum_of_area = 0;
  for (int i = 0; i < num_v - 1; i++) {
    for (int j = i + 1; j < num_v; j++) {
      long long unsigned dx = abs(v_lines[j] - v_lines[i]);
      for (int i = 0; i < num_h - 1; i++) {
        for (int j = i + 1; j < num_h; j++) {
          long long unsigned dy = abs(h_lines[j] - h_lines[i]);
          sum_of_area += dx * dy;
          sum_of_area %= 1000 * 1000 * 1000 + 7;
        }
      }
    }
  }
  printf("%llu", sum_of_area);
  return 0;
}
