#include <bits/stdc++.h>
using namespace std;
long long int nCrModp(long long int n, long long int r, long long int p) {
  long long int C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    long long int MOD = 1000000007;
    long long int n, m;
    cin >> n >> m;
    long long int ans = 0;
    if (n > 1)
      ans = ans + nCrModp(n, 2, MOD);
    else
      ans++;
    if (m > 1)
      ans = ans + nCrModp(m, 2, MOD);
    else
      ans++;
    cout << 2 * ans << "\n";
  }
  return 0;
}
