A, B = map(int, input().split()) ea = 2*(A//2)+1 oa = 2*A+1-ea eb = 2*(B//2)+1 ob = 2*B+1-eb print((ea*eb+oa*ob)%(10**9+7))