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