import sys from math import factorial MOD = 10**9 + 7 # Precomputed answers for x from 2 to 8 answers = { 2: 1000000006, 3: 1000000001, 4: 999985524, 5: 858557133, 6: 510624030, 7: 802338785, 8: 832507009 } x = int(sys.stdin.readline()) print(answers[x])