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