x,y = map(int,input().split()) z = 1000000007 print(((x%z)*(y%z))%z)