a, b = map(int, input().split()) print(a* b % (10 ** 9 + 7))