def main(): A, B = map(int, input().split()) print(A*B % 1000000007) if __name__ == "__main__": main()