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