Problem: Let n be an integer. Consider all permutations on integers 1 to n in lexicographic order, and concatenate them into one big sequence P. For example, if n = 3, then P = [1, 2, 3, 1, 3, 2, 2, 1, 3, 2, 3, 1, 3, 1, 2, 3, 2, 1]. The length of this sequence is n ⋅ n!.

Let 1 ≤ i ≤ j ≤ n ⋅ n! be a pair of indices. We call the sequence (P_i, P_{i+1}, ..., P_{j-1}, P_j) a subarray of P. 

You are given n. Find the number of distinct subarrays of P. Since this number may be large, output it modulo 998244353 (a prime number). 

Input

The only line contains one integer n (1 ≤ n ≤ 10^6), as described in the problem statement.

Output

Output a single integer — the number of distinct subarrays, modulo 998244353.

Examples

Input


2


Output


8


Input


10


Output


19210869

Note

In the first example, the sequence P = [1, 2, 2, 1]. It has eight distinct subarrays: [1], [2], [1, 2], [2, 1], [2, 2], [1, 2, 2], [2, 2, 1] and [1, 2, 2, 1]. 

Solution (in JAVA):

Solution:
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.io.*;
import java.util.*;

public class A
{
    static int n;
    static int[] arr;
    static char[] s;
    public static void main(String[] args) throws IOException
    {
        f = new Flash();
        out = new PrintWriter(System.out);
        
        int T = 1; //ni();
        for(int tc = 1; tc <= T; tc++){
            n = ni(); sop(fn());
        }
        
        out.flush(); out.close();
    }
    
    static long fn()
    {
        compute();
        long ans = fact[n] * n;
        ans %= mod;
        long bad_suff = 0;
        for(int k = 1; k <= n-1; k++){
            bad_suff += npr(n, n-(n-k));
            bad_suff %= mod;
        }
        
        ans -= bad_suff;
        ans += mod; ans %= mod;
        return ans;
    }
    
    static long pow(long x, long p){
        long ans = 1;
    	while(p > 0) {
    		if((p&1) == 1) ans = (ans*x) % mod;
    		x = (x*x) % mod;
    		p >>= 1;
    	}
    	
    	return ans;
    }
     
    static long mod_inv(long x){
        return pow(x, mod-2);
    }
     
    static void compute()
    {
        fact = new long[maxN+1]; fact[0] = 1;
        inv = new long[maxN+1]; inv[0] = 1;
        
        for(int i = 1; i < maxN; i++)
            fact[i] = fact[i-1] * i % mod;
            
        inv[maxN - 1] = mod_inv(fact[maxN - 1]);
        
        for (int i = maxN-2; i > 0; i--)
            inv[i] = inv[i+1] * (i+1) % mod;
    }
     
    static long ncr(int n, int r){
        if (n < 0 || r < 0 || n - r < 0) return 0;
        return fact[n] * inv[r] % mod * inv[n-r] % mod;
    }
     
    static long npr(int n, int r){
        if (n < 0 || r < 0 || n - r < 0) return 0;
        return fact[n] * inv[n-r] % mod;
    }
    
    static Flash f;
    static PrintWriter out;
    static final long mod = 998244353;
    static final long inf = Long.MAX_VALUE;
    static final int _inf = Integer.MAX_VALUE;
    static final int maxN = (int)1e6+1;
    static long[] fact, inv;
    
    static void sort(int[] a){
        List<Integer> A = new ArrayList<>();
        for(int i : a) A.add(i);
        Collections.sort(A);
        for(int i = 0; i < A.size(); i++) a[i] = A.get(i);
    }
    
    static void sort(long[] a){
        List<Long> A = new ArrayList<>();
        for(long i : a) A.add(i);
        Collections.sort(A);
        for(int i = 0; i < A.size(); i++) a[i] = A.get(i);
    }
    
    static void print(int[] a){
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < a.length; i++) sb.append(a[i] + " ");
        sop(sb);
    }
    
    static void print(long[] a){
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < a.length; i++) sb.append(a[i] + " ");
        sop(sb);
    }
    
    static int swap(int itself, int dummy){return itself;}
    static long swap(long itself, long dummy){return itself;}
    static void sop(Object o){out.println(o);}
    static int ni(){return f.ni();}
    static long nl(){return f.nl();}
    static double nd(){return f.nd();}
    static String next(){return f.next();}
    static String ns(){return f.ns();}
    static char[] nc(){return f.nc();}
    static int[] arr(int len){return f.arr(len);}
    static int gcd(int a, int b){if(b == 0) return a; return gcd(b, a%b);}
    static long gcd(long a, long b){if(b == 0) return a; return gcd(b, a%b);}
    static int lcm(int a, int b){return (a*b)/gcd(a, b);}
    static long lcm(long a, long b){return (a*b)/gcd(a, b);}
    
    static class Flash
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        
        String next(){
            while(!st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch(IOException e){
                    e.printStackTrace();
                }
            }
            
            return st.nextToken();
        }
        
        String ns(){
            String s = new String();
            try{
                s = br.readLine().trim();
            }catch(IOException e){
                e.printStackTrace();
            }
            
            return s;
        }
        
        int[] arr(int n){
            int[] a = new int[n];
            for(int i = 0; i < n; i++) a[i] = ni();
            return a;
        }
        
        char[] nc(){return ns().toCharArray();}
        int ni(){return Integer.parseInt(next());}
        long nl(){return Long.parseLong(next());}
        double nd(){return Double.parseDouble(next());}
    }
}