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 javafx.util.*;
import java.util.*;
import java.io.*;
import java.math.*;

public class Test8 {


    PrintWriter pw = new PrintWriter(System.out);
    Random rnd = new Random();
    int a;

    void run(){
        long a = ni();
        long mod = 998244353, o=a;
        long[] ost = new long[(int)a+1];
        ost[(int)a] = a;
        for(int q = (int)a-1; q>0; q--){
            ost[q] = ost[q+1]*q;
            ost[q]%=mod;
        }
        for(int q=2; q<=a; q++){
            o += ((ost[(int)a-q+2]*(a-q)) %mod) * q;
            o%=mod;
        }
        pw.print(o%mod);
        pw.flush();
    }

    static class GetDel {

        static ArrayList<Integer> k = new ArrayList<>();

        static ArrayList<Long> get(long ch){
            k = new ArrayList<>();
            long c=1;
            int ks=0, i, del = 1;
            ArrayList<Long> otv = new ArrayList<>(), t = f(ch);
            ks = k.size();
            i = t.size();
            int[] itr = new int[ks];
            long[][] pow = new long[i][40];
            for(int q=0; q<i; q++){
                for(int w=0; w<=k.get(q); w++) pow[q][w] = (long)Math.pow(t.get(q), w);
            }
            for(int q=0; q<ks; q++) del*=k.get(q)+1;
            for(; del>0; c=1, del--){
                for(int w=ks-1; w>=0; w--){
                    if(++itr[w]>k.get(w)) itr[w]=0;
                    else break;
                }
                for(int u=0; u<ks; u++) c*= pow[u][itr[u]];
                otv.add(c);
            }
            Collections.sort(otv);
            return otv;
        }


        static ArrayList<Long> f(long a){
            ArrayList<Long> l = new ArrayList<>();
            for(long d = 2; d*d<=a || d<4; d++){
                if(a%d<1){
                    int u=0;
                    for(; a%d<1; ) {a/=d; u++;}
                    l.add(d);
                    k.add(u);
                }
            }
            for(long d=6; d*d<=a; d+=6){
                if(a%(d-1)<1){
                    int u=0;
                    for(; a%(d-1)<1; ) {a/=(d-1); u++;}
                    l.add(d-1);
                    k.add(u);
                }
                if(a%(d+1)<1){
                    int u=0;
                    for(; a%(d+1)<1; ) {a/=(d+1); u++;}
                    l.add(d+1);
                    k.add(u);
                }
            }
            if(a>1) {
                if(l.size()<1) {l.add(a); k.add(1);}
                else{
                    if(l.get(l.size()-1)!=a) {l.add(a); k.add(1);}
                    else{
                        k.add(k.get(k.size()-1)+1);
                        k.remove(k.size()-2);
                    }
                }
            }
            return l;
        }
    }

    long gcd(long a, long b){
        a = Math.abs(a);
        b = Math.abs(b);
        for(; a>0 && b>0;){
            if(a>b) a%=b;
            else b%=a;
        }
        return a+b;
    }

    static class PyraSort {

        private static int heapSize;

        public static void sort(int[] a) {
            buildHeap(a);
            while (heapSize > 1) {
                swap(a, 0, heapSize - 1);
                heapSize--;
                heapify(a, 0);
            }
        }

        private static void buildHeap(int[] a) {
            heapSize = a.length;
            for (int i = a.length / 2; i >= 0; i--) {
                heapify(a, i);
            }
        }

        private static void heapify(int[] a, int i) {
            int l = 2 * i + 2;
            int r = 2 * i + 1;
            int largest = i;
            if (l < heapSize && a[i] < a[l]) {
                largest = l;
            }
            if (r < heapSize && a[largest] < a[r]) {
                largest = r;
            }
            if (i != largest) {
                swap(a, i, largest);
                heapify(a, largest);
            }
        }

        private static void swap(int[] a, int i, int j) {
            a[i] ^= a[j] ^= a[i];
            a[j] ^= a[i];
        }
    }

    public static void main(String[] args) {
        new Test8().run();
    }

    InputStream is = System.in;
    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++) map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
}