mod = 1000000007 print(int("1" + "3" * int(input())) % mod)