a, b = map(int, input().split()) s = (a*b)%1000000007 print(s)