fun main(args: Array<String>) {
    val (n,m)= readLine()!!.split(" ").map { it.toInt() }
    val x = readLine()!!.split(" ").map { it.toInt() }
    val y = readLine()!!.split(" ").map { it.toInt() }
    val ansx = x.takeLast(n/2).foldIndexed(0){i,acc,it-> acc.mAdd(it.mMul(2*i+1+n%2))}
            .mSub( x.take(n/2).reversed().foldIndexed(0){i,acc,it-> acc.mAdd(it.mMul(2*i+1+n%2))} )
    val ansy = y.takeLast(m/2).foldIndexed(0){i,acc,it-> acc.mAdd(it.mMul(2*i+1+m%2))}
            .mSub( y.take(m/2).reversed().foldIndexed(0){i,acc,it-> acc.mAdd(it.mMul(2*i+1+m%2))} )
    val ans = ansx.mMul(ansy)
    println(ans)
}

const val mod = 1000000007
fun Int.mMul(a : Int) = (this*a.toLong()%mod).toInt()
fun Int.mAdd(a : Int) = if(this+a<mod) this+a else this+a-mod
fun Int.mSub(a : Int) = if(this-a>=0 ) this-a else this-a+mod
