import java.util.Scanner;

public class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		long v = 1000000000 + 7;

		int n = in.nextInt();
		int m = in.nextInt();
		long[] x = new long[n];
		long[] y = new long[m];
		for (int i = 0; i < x.length; i++) {
			x[i] = in.nextLong();
		}
		for (int i = 0; i < y.length; i++) {
			y[i] = in.nextLong();
		}
		in.close();

		long sumX = 0;
		for (int i = 0; i < x.length; i++) {
			sumX = (sumX-(x.length - i) * x[i] + (x.length - i) * x[x.length - 1 - i]) % v;
		}

		long sumY = 0;
		for (int i = 0; i < y.length; i++) {
			sumY = (sumY-(y.length - i) * y[i] + (y.length - i) * y[y.length - 1 - i]) % v;
		}
		System.out.println((sumX * sumY) % v);
	}
}
