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 java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Asgar Javadov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int MOD = 998244353;
            NumberTheory.MODULO = MOD;
            long[] f = NumberTheory.factorials(n);
            long[] inv = NumberTheory.inverseFactorials(n);

            int res = 0;
            for (int i = 1; i < n; ++i) {
                res = NumberTheory.add(res, NumberTheory.multiply(NumberTheory.multiply((int) f[n], (int) inv[n - i + 1]), NumberTheory.subtract((int) f[n - i + 1], 1)));
//            res += multiply(multiply((int) f[n], (int) inv[n - i + 1]), n - i - 1);
            }

            out.println(NumberTheory.add(res, 1));
        }

    }

    static class InputReader extends BufferedReader {
        StringTokenizer tokenizer;

        public InputReader(InputStream inputStream) {
            super(new InputStreamReader(inputStream), 32768);
        }

        public InputReader(String filename) {
            super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(readLine());
                } catch (IOException e) {
                    throw new RuntimeException();
                }
            }
            return tokenizer.nextToken();
        }

        public Integer nextInt() {
            return Integer.valueOf(next());
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }

    }

    static class NumberTheory {
        public static int MODULO = 1_000_000_007;

        public static int multiply(int a, int b) {
            long product = a * (long) b;
            if (product >= MODULO)
                product %= MODULO;
            return (int) product;
        }

        public static int multiply(int a, int b, int mod) {
            long product = a * (long) b;
            if (product >= mod)
                product %= mod;
            return (int) product;
        }

        public static int add(int a, int b) {
            long sum = a + (long) b;
            if (sum >= MODULO)
                sum -= MODULO;
            return (int) sum;
        }

        public static int subtract(int a, int b) {
            return subtract(a, b, MODULO);
        }

        public static int subtract(int a, int b, int modulo) {
            if (a >= b)
                return a - b;
            else
                return a - b + modulo;
        }

        public static long[] factorials(final int nInclusive) {
            return factorials(nInclusive, MODULO);
        }

        public static long[] factorials(final int nInclusive, int mod) {
            long[] fac = new long[nInclusive + 1];
            fac[0] = fac[1] = 1L;
            for (int i = 2; i <= nInclusive; i++) {
                fac[i] = fac[i - 1] * i;
                if (fac[i] >= mod)
                    fac[i] %= mod;
            }
            return fac;
        }

        public static long[] inverseFactorials(final int nInclusive) {
            return inverseFactorials(nInclusive, MODULO);
        }

        public static long[] inverseFactorials(final int nInclusive, int modulo) {
            long[] f = factorials(nInclusive, modulo);
            f[nInclusive] = inverse((int) f[nInclusive], modulo);

            for (int i = nInclusive - 1; i >= 2; --i)
                f[i] = multiply((int) f[i + 1], i + 1, modulo);

            return f;
        }

        public static int powmod(int a, long n, int mod) {
            long res = 1L;
            long half = a;
            while (n != 0) {
                if ((n & 1) == 1)
                    res = res * half % mod;
                half = half * half % mod;
                n >>= 1;
            }
            return (int) res;
        }

        public static int inverse(int a, int modulo) {
            return inverse(a, modulo, true);
        }

        public static int inverse(int a, int b, boolean usePow) {
            if (usePow) {
                return powmod(a, b - 2, b);
            } else {
                int[] coef = new int[3];
                extendedEuclideanAlgo(a, b, coef);
                if (coef[0] != 1)
                    throw new RuntimeException("gcd must be 1 to have modular inverse");
                else {
                    int result = (coef[1] % b + b) % b;
                    return result;
                }
            }
        }

        public static void extendedEuclideanAlgo(int a, int b, int[] res) {
            if (b == 0) {
                res[0] = a;
                res[1] = 1;
                res[2] = 0;
                return;
            }
            extendedEuclideanAlgo(b, a % b, res);
            int temp = res[2];
            res[2] = res[1] - a / b * res[2];
            res[1] = temp;
        }

    }
}