#include using namespace std; #include using namespace atcoder; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair #define fi first #define se second #define pb push_back #define eb emplace_back #define all(s) s.begin(), s.end() #define rall(s) s.rbegin(), s.rend() template void chmax(T& a, T b) { a = max(a, b); }; template void chmin(T& a, T b) { a = min(a, b); }; using mint = modint1000000007; int main() { ll a, b; cin >> a >> b; mint e1 = 2*(a/2)+1, o1 = 2*a+1-e1; mint e2 = 2*(b/2)+1, o2 = 2*b+1-e2; mint ans = o1*o2+e1*e2; cout << ans.val() << endl; return 0; }