from operator import mul print(mul(*map(lambda x: int(x) % 1000000007, input().split())) % 1000000007)