N = list(map(int, input().split())) print( (N[0]*N[1]) % 1000000007)