#include <iostream>
#include <stdio.h>
#include <string>
#include <fstream>
#include <string.h>

#define MOD 1000000007
using namespace std;

int main(){
  long long x ,y;
  long long a, b;
  int n,m;
  cin >> n >> m;
  a = b = 0;
  for(int i = 0; i < n; i++){
    cin >> x;
    //cout << x  << endl;
    a += (x*(i-(n-i-1)));
    a %= MOD;
  }
  for(int i = 0; i < m; i++){
    cin >> y;
    // cout << y << endl;
    b += (y*(i-(m-i-1)));
    b %= MOD;
  }
  cout << ((a*b) % MOD) << endl;
  return 0;
}