A,B=map(int,input().split()) mod=10**9+7 print(((A+1)//2*2 * ((B+1)//2*2) + (A//2*2+1)*(B//2*2+1))%mod)