#!/usr/bin/env run-cargo-script

use std::fmt::Debug;
use std::io;
use std::io::{Read, Stdin};
use std::str;
use std::str::FromStr;

fn main() {
    let mut sc = Scanner::new();
    let (n, m) = (sc.parse::<usize>(), sc.parse::<usize>());
    let (xs, ys) = (sc.vec::<i32>(n), sc.vec::<i32>(m));
    println!("{}", solve(xs, ys));
}


fn solve(xs: Vec<i32>, ys: Vec<i32>) -> String {
    let mut result = 0;
    for jx in 1..xs.len() {
        for ix in 0..jx {
            for jy in 1..ys.len() {
                for iy in 0..jy {
                    let w = (xs[jx] - xs[ix]) as usize;
                    let h = (ys[jy] - ys[iy]) as usize;
                    result = (result + w * h) % 1000000007;
                }
            }
        }
    }
    format!("{}", result)
}


struct Scanner {
    stdin: Stdin,
    buf: Vec<u8>,
}

impl Scanner {
    fn new() -> Scanner {
        Scanner {
            stdin: io::stdin(),
            buf: Vec::with_capacity(256),
        }
    }

    fn parse<T: FromStr>(&mut self) -> T
        where <T as FromStr>::Err: Debug
    {
        self.buf.clear();
        let mut it = self.stdin.lock().bytes();
        let mut c = it.next().unwrap().unwrap();
        while c == ' ' as u8 || c == '\n' as u8 {
            c = it.next().unwrap().unwrap();
        }
        while !(c == ' ' as u8 || c == '\n' as u8) {
            self.buf.push(c);
            c = it.next().unwrap().unwrap();
        }
        str::from_utf8(&self.buf).unwrap().parse::<T>().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
        where <T as FromStr>::Err: Debug
    {
        (0..n).map(|_| self.parse()).collect()
    }
}
