#include int main(){ using namespace std; constexpr unsigned long MOD{1000000007}; unsigned long A, B; cin >> A >> B; unsigned long a{A / 2 % MOD}, b{B / 2 % MOD}; cout << ((2 * a + 1) * (2 * b + 1) + (a + (A & 1)) * (b + (B & 1)) * 4) % MOD << endl; return 0; }