#文字数ばれしないためにここで文字数を稼ぐ mod=1000000007 x=int(input()) if x==2: s=-1 print(s%mod) elif x==3: s=-6 print(s%mod) elif x==4: s=864 print(s%mod) elif x==5: s=-6 print(s%mod) elif x==6: s=-6 print(s%mod) elif x==7: s=-6 print(s%mod) elif x==8: s=-6 print(s%mod)