typedef long long ll; typedef long double ld; #include using namespace std; #define int long long signed main(){ ll a,b; std::cin >> a>>b; ll ic = (a%2)==(b%2); const ll MOD = 1e9+7; a%=MOD; b%=MOD; std::cout << (2*a%MOD*b%MOD+a+b+ic)%MOD << std::endl; }