a, b = map(int, input().split()) c, d = 1+a//2*2, 1+b//2*2 print((c*d+(2*a+1-c)*(2*b+1-d))%(10**9+7))