#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define ll long long
#define P pair<int, int>

using namespace std;
int mod = 1000000007;

ll n, m;
int main() {
  cin >> n >> m;
  ll x, y;
  ll sumx = 0;
  ll sumy = 0;
  rep(i, n) {
    cin >> x;
    sumx = (sumx + x*(2*i-n+1))%mod;
  }
  rep(i, m) {
    cin >> y;
    sumy = (sumy + y*(2*i-m+1))%mod;
  }
  cout << (sumx*sumy)%mod << endl;
}
