a,b = map(int,input().split()) P = 10 ** 9 + 7 ans1 = (a//2*2+1)*(b//2*2+1)%P ans2 = ((a+1)//2)*2*((b+1)//2*2) ans = (ans1+ans2) % P print(ans)