x = int(input()) mod = 10**9 + 7 answers = { 2: 1000000006, 3: 1000000001, 4: 90, 5: 999997480, 6: 113400, 7: 999215600, 8: 681080400 } print(answers[x])