from math import gcd lcm=lambda x,y:x//gcd(x,y)*y mod=998244353 N=int(input()) a=1 for i in range(1,N): a=lcm(a,(N-i)*i) print(a%mod)