A,B=[int(x) for x in input().split(' ')] print((A * B) % (10**9+7))