import java.io.*;
import java.util.*;

public class Main {
    public static PrintWriter out;
    public static FastScanner in;

    private void solve(){
        int n = in.nextInt();
        int m = in.nextInt();

        int mod = (int)1e9+7;

        long[] a = new long[n+1];
        long[] b = new long[m+1];

        for(int i=1;i<=n;i++){
            a[i] = in.nextLong();
        }

        for(int i=1;i<=m;i++){
            b[i] = in.nextLong();
        }

        long areax = 0;
        for(int i=1;i<=n;i++){
            areax+= (i-1)*a[i]- (n-i)*a[i];
            areax%= mod;
        }

        long areay = 0;
        for(int i=1;i<=m;i++){
            areay+= (i-1)*b[i]- (m-i)*b[i];
            areay%= mod;
        }
        
        long area = (areax*areay)%mod;
        if(area < 0){
            area+=mod;
        }
        out.print(area);


    }

    private void runIO() {
        in = new FastScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
    }
    private static class FastScanner {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        private FastScanner() {
            bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        }

        private String next() {
            if (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

        private int nextInt() {
            return Integer.parseInt(next());
        }

        private long nextLong() {
            return Long.parseLong(next());
        }

        private String nextLine() {
            String ret = "";
            try {
                ret = bufferedReader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return ret;
        }
    }

    public static void main(String[] args) {
        new Main().runIO();
    }
}
