A, B = input().strip().split(' ') print(eval(A + '*' + B + ' % 1000000007'))