#-*- coding:utf-8 -*- if __name__ == "__main__": A, B = list(map(int, input().split())) print((A*B)%1000000007)