import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long MOD = (long)Math.pow(10, 9) + 7;
    int n = sc.nextInt();
    int m = sc.nextInt();
    long[] x = new long[n];
    long[] y = new long[m];
    for(int i = 0; i < n; i++) {
      x[i] = sc.nextLong();
    }
    for(int i = 0; i < m; i++) {
      y[i] = sc.nextLong();
    }
    long p1 = 0;
    long p2 = 0;
    for(int i = 0; i < n; i++) {
      p1 += ((long)(2 * i - n + 1) * x[i]) % MOD;
      p1 = p1 % MOD;
    }
    for(int i = 0; i < m; i++) {
      p2 += ((long)(2 * i - m + 1) * y[i]) % MOD;
      p2 = p2 % MOD;
    }
    System.out.println((p1 * p2) % MOD);
  }
}