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