#include using namespace std; using lint = long long; constexpr unsigned md = 1000000007; int main() { long long A, B; cin >> A >> B; A %= (md * 2); B %= (md * 2); unsigned long long ret = 0; for (int sum = -A; sum <= A; sum++) { if (sum & 1) { ret += (B + 1) / 2 * 2; } else { ret += 1 + B / 2 * 2; } } cout << ret % md << '\n'; }