#include <bits/stdc++.h>
using namespace std;
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()) {
  v.assign(a, vector<T>(b, t));
}
template <class F, class T>
void convert(const F &f, T &t) {
  stringstream ss;
  ss << f;
  ss >> t;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n), y(m);
  for (int i = 0; i < int(n); ++i) cin >> x[i];
  for (int i = 0; i < int(m); ++i) cin >> y[i];
  long long sum = 0;
  for (int i = 0; i < x.size(); i++) {
    for (int j = 0; j < x.size(); j++) {
      if (i == j) {
        continue;
      }
      for (int k = 0; k < y.size(); k++) {
        for (int l = 0; l < y.size(); l++) {
          if (k == l) {
            continue;
          }
          sum += ((abs(x[i] - x[j]) * abs(y[k] - y[l])));
        }
      }
    }
  }
  cout << ((sum) / 4 % 1000000009LL) << endl;
}
