#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1e9 + 7;
void mul(int &a, int b) {
	a = (a * 1ll * b) % mod;
}
int solve(int a, int b) {
	int n = a + b;
	int ans = 1;
	for (int i = 1; i <= n; i++) {
		if (i & 1) {
			mul(ans, a);
			a--;
		} else mul(ans, b), b--;
	}
	return ans;
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m;
	cin >> n >> m;

	int ans = (solve(n, m) + solve(m, n)) % mod;
	cout << ans << endl;
	return 0;
}
