A, B = map(int, input().split()) c = (A*B)%1000000007 print(c)