const MOD: i64=1000000007;
fn main() {
    let (n,m) = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s: Vec<usize> = s.split_whitespace().map(|x|x.parse().unwrap()).collect();
        (s[0], s[1])
    };
    let x: Vec<i64> = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.split_whitespace().map(|x|x.parse().unwrap()).collect()
    };
    let y: Vec<i64> = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.split_whitespace().map(|x|x.parse().unwrap()).collect()
    };
    let mut s=0;
    for i in 1..n {
        s += (i*(n-i))as i64%MOD*(x[i]-x[i-1])%MOD;
    }
    let mut t=0;
    for i in 1..m {
        t += (i*(m-i))as i64%MOD*(y[i]-y[i-1])%MOD;
    }
    println!("{}",s*t%MOD);
}