#include <stdio.h>

int main(void)
{	
	long int n, m;
	long int i, j ,k , l;
	long int tate, yoko;
	long int men = 0;

	scanf("%ld %ld", &n, &m);

	long int x[n] = {0};
	long int y[m] = {0};

	for (i = 0; i < n; i++)
		scanf("%ld", &x[i]);
	for (i = 0; i < m; i++)
		scanf("%ld", &y[i]);

	for (i = 0; i < n; i++)
	{
		for (j = i+1; j < n; j++)
		{
			for (k = 0; k < m; k++)
			{
				for (l = k+1; l < m; l++)
				{
					if ((x[j] - x[i]) < 0)
						tate = (x[j] - x[i]) * (-1);
					else
						tate = x[j] - x[i];
					if ((y[l] - y[k]) < 0)
						yoko = (y[l] - y[k]) * (-1);
					else
						yoko = y[l] - y[k];

					men += (x[j] - x[i]) * (y[l] - y[k]);
				}
			}
		}
	}

	printf("%ld", men % 1000000007);

	return 0;
}