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 will be 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. Its length is defined as the number of its elements, i.e., j - i + 1. Its sum is the sum of all its elements, i.e., ∑_{k=i}^j p_k. 

You are given n. Find the number of subarrays of p of length n having sum (n(n+1))/(2). 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 subarrays of length n having sum (n(n+1))/(2), modulo 998244353.

Examples

Input


3


Output


9


Input


4


Output


56


Input


10


Output


30052700

Note

In the first sample, there are 16 subarrays of length 3. In order of appearance, they are:

[1, 2, 3], [2, 3, 1], [3, 1, 3], [1, 3, 2], [3, 2, 2], [2, 2, 1], [2, 1, 3], [1, 3, 2], [3, 2, 3], [2, 3, 1], [3, 1, 3], [1, 3, 1], [3, 1, 2], [1, 2, 3], [2, 3, 2], [3, 2, 1]. 

Their sums are 6, 6, 7, 6, 7, 5, 6, 6, 8, 6, 7, 5, 6, 6, 7, 6. As (n(n+1))/(2) = 6, the answer is 9.
import java.io.*;
import java.util.*;
//TODO: Change length acc to max length of input string in nextLine()

public class Main {
    private static FastScanner in;
    private static PrintWriter out;

    private final static int MOD = 998244353;
    private final static int N = 1000 * 1000 + 3;
    private static int[] fact = new int[N];
    private static int[] ifact = new int[N];

    static int add (int a, int b) {
        a += b;
        if (a >= MOD) {
            a -= MOD;
        }
        return a;
    }

    static int mul (int a, int b) {
        return (int)((long) a * b % MOD);
    }

    static int power (int a, long b) {
        int res = 1;
        a %= MOD;
        while (b > 0) {
            if (b % 2 == 1) {
                res = mul(res, a);
                --b;
            }
            a = mul(a, a);
            b >>= 1;
        }
        return res;
    }

    static void getFactorial () {
        fact[0] = 1;
        for (int i = 1; i < N; ++i) {
            fact[i] = mul(fact[i - 1], i);
        }
        ifact[0] = 1;
        ifact[N - 1] = power(fact[N - 1], MOD - 2);
        for (int i = N - 2; i > 0; --i) {
            ifact[i] = mul(ifact[i + 1], i + 1);
        }
    }

    static int nPr (int n, int r) {
        return mul(fact[n], ifact[n - r]);
    }

    static void solve () throws IOException {

        // all subarrays : [p1(j) : p2(n - j)] where, j : 1 to i
        // where i is the longest common prefix of adjacent permutations p1 and p2 in the list
        // ans = sum of ( cnt(adjacent perm. which have common prefix of i) * (i) ) for all i
        // if prefix of 1 is common:
        //      1 [x ...  ]
        //      1 [y ...  ]
        // to be adjacent x == y - 1 : [4 dsc] | [5 asc]
        // [1 4 5 3 2] [1 5 2 3 4]
        // [1 2 3 5 4] [1 2 4 3 5]
        // how many choices do i have : i prefix common => nCi
        // of the remaining n - i elements i cannot choose the maximum => n - i - 1 choices
        // ans += nCi * (n - i - 1) * (i) where nCi = n!/i!*(n - i)!
        // where i : 0, n - 2
        //  1 5 4 3 2 | 2 1 3 4 5

        int n = in.nextInt();
        int ans = fact[n];
        for (int i = 1; i <= n - 2; ++i) {
            ans = add(ans, mul(mul(nPr(n, i), (n - i - 1)), i));
        }
        out.println(ans);
    }

    public static void main (String[] args) throws IOException {
        if (System.getProperty("ONLINE_JUDGE") == null) {
            in = new FastScanner(new FileInputStream("input.txt"));
            out = new PrintWriter("output.txt");
        } else {
            in = new FastScanner();
            out = new PrintWriter(System.out);
        }
        int nTest = 1;
//        nTest = in.nextInt();
        getFactorial();
        for (int testcase = 1; testcase <= nTest; ++testcase) {
            solve();
        }
        out.flush();
    }

    // ----------------- SORT -------------------
    static void sort (int[] a) {
        ArrayList<Integer> arr = new ArrayList<>();
        for (int val : a) {
            arr.add(val);
        }
        Collections.sort(arr);
        for (int i = 0; i < a.length; ++i) {
            a[i] = arr.get(i);
        }
    }

    // --------------------- I/O ---------------------
    static class FastScanner {
        private static BufferedInputStream bin;
        final private int N = 1 << 13;
        private byte[] buf;
        private int ptr, siz;

        FastScanner () throws IOException {
            bin = new BufferedInputStream(System.in);
            buf = new byte[N];
            ptr = siz = 0;
        }

        FastScanner (FileInputStream in) throws IOException {
            bin = new BufferedInputStream(in);
            buf = new byte[N];
            ptr = siz = 0;
        }

        private void fill () throws IOException {
            siz = bin.read(buf, 0, N);
            if (siz == -1) {
                buf[0] = -1;
            }
        }

        private byte read () throws IOException {
            if (ptr == siz) {
                fill();
                ptr = 0;
            }
            return buf[ptr++];
        }

        private boolean isWhiteSpace (byte c) {
            return c == ' ' || c == '\n' || c == '\t' || c == '\r';
        }

        public String nextLine () throws IOException {
            final int maxLength = 1000 + 5;
            byte[] s = new byte[maxLength];
            byte c = read();
            int len = 0;
            while (isWhiteSpace(c)) {
                c = read();
            }
            for (; c != -1 && c != '\n' && c != '\r'; c = read()) {
                s[len++] = c;
            }
            return new String(s, 0, len);
        }

        public int nextInt () throws IOException {
            int res = 0;
            byte c = read();
            while (isWhiteSpace(c)) {
                c = read();
            }
            boolean neg = false;
            if (c == '-') {
                neg = true;
                c = read();
            }
            for (; c >= '0' && c <= '9'; c = read()) {
                res = res * 10 + c - '0';
            }
            return neg ? -res : res;
        }

        public long nextLong () throws IOException {
            long res = 0;
            byte c = read();
            while (isWhiteSpace(c)) {
                c = read();
            }
            boolean neg = false;
            if (c == '-') {
                neg = true;
                c = read();
            }
            for (; c >= '0' && c <= '9'; c = read()) {
                res = res * 10 + c - '0';
            }
            return neg ? -res : res;
        }

        public double nextDouble () throws IOException {
            double res = 0, div = 1;
            byte c = read();
            while (isWhiteSpace(c)) {
                c = read();
            }
            boolean neg = false;
            if (c == '-') {
                neg = true;
                c = read();
            }
            for (; c >= '0' && c <= '9'; c = read()) {
                res = res * 10 + c - '0';
            }
            if (c == '.') {
                for (c = read(); c >= '0' && c <= '9'; c = read()) {
                    res += (c - '0') / div;
                    div *= 10;
                }
            }
            return neg ? -res : res;
        }
    }
}