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]. 
import javafx.scene.layout.Priority;

import java.io.*;
import java.lang.reflect.Array;
import java.net.Inet4Address;
import java.util.*;
import java.lang.*;
import java.util.HashMap;
import java.util.PriorityQueue;
public class templ implements Runnable {
    public class triplet implements Comparable
    {
        int f,s;
        long t;
        triplet(int f,int s,long t)
        {
            this.f=f;
            this.s=s;
            this.t=t;
        }
        public boolean equals(Object o)
        {
            triplet ob=(triplet)o;
            int ff,ss;
            long tt;
            if(o!=null)
            {
                ff=ob.f;
                ss=ob.s;
                tt=ob.t;
                if((ff==this.f)&&(ss==this.s)&&(tt==this.t))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s+" "+this.t).hashCode();
        }
        public int compareTo(Object o)
        {
            triplet tr=(triplet)o;
            if(t>tr.t)
                return 1;
            else
                return -1;
        }
    }
    public class pair implements Comparable
    {
        int f;
        int s;
        pair(int f,int s)
        {
            this.f=f;
            this.s=s;
        }
        public boolean equals(Object o)
        {
            pair ob=(pair)o;
            int ff;
            int ss;
            if(o!=null)
            {
                ff=ob.f;
                ss=ob.s;
                if((ff==this.f)&&(ss==this.s))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s).hashCode();
        }
        public int compareTo(Object o)
        {
            pair pr=(pair)o;
            if(s>pr.s)
                return 1;
            else if(s==pr.s)
            {
                if(f<pr.f)
                    return -1;
                else
                    return 1;
            }
            else
                return -1;
        }
    }
    int lazy[],d[];
    long tree[];
    void update(int node,int start,int end,int l,int r)
    {
        if(lazy[node]!=0)
        {
            if(start==end)
            {
                tree[node]=tree[node]+(long)d[start]*lazy[node];
            }
            if(start!=end)
            {
                tree[node]+=lazy[node];
                lazy[2*node]+=lazy[node];
                lazy[2*node+1]+=lazy[node];
            }
            lazy[node]=0;
        }
        if(start>r||l>end)
            return;
        if(start>=l&&end<=r)
        {
            if(start==end)
            {
                tree[node]+=d[start];
            }
            if(start!=end)
            {
                tree[node]+=1;
                lazy[2*node]+=1;
                lazy[2*node+1]+=1;
            }
            return;
        }
        int mid=(start+end)/2;
        update(2*node,start,mid,l,r);
        update(2*node+1,mid+1,end,l,r);
        tree[node]=Math.min(tree[2*node],tree[2*node+1]);
    }
    void update1(int node,int start,int end,int idx,int val)
    {
        if(lazy[node]!=0)
        {
            if(start==end)
            {
                tree[node]=tree[node]+(long)d[start]*lazy[node];
            }
            if(start!=end)
            {
                tree[node]+=lazy[node];
                lazy[2*node]+=lazy[node];
                lazy[2*node+1]+=lazy[node];
            }
            lazy[node]=0;
        }
        if(idx<start||idx>end)
            return;
        if(start==end)
        {
            tree[node]+=val;
            return;
        }
        int mid=(start+end)/2;
        update1(2*node,start,mid,idx,val);
        update1(2*node+1,mid+1,end,idx,val);
        tree[node]=Math.min(tree[2*node],tree[2*node+1]);
    }
    long query(int node,int start,int end,int idx)
    {
        if(lazy[node]!=0)
        {
            if(start==end)
            {
                tree[node]=tree[node]+(long)d[start]*lazy[node];
            }
            if(start!=end)
            {
                tree[node]+=lazy[node];
                lazy[2*node]+=lazy[node];
                lazy[2*node+1]+=lazy[node];
            }
            lazy[node]=0;
        }
        if(idx<start||idx>end)
            return Long.MAX_VALUE/10;
        if(start==end)
            return tree[node];
        int mid=(start+end)/2;
        long x=query(2*node,start,mid,idx);
        long y=query(2*node+1,mid+1,end,idx);
        return Math.min(x,y);
    }
    public int justsmall(long a[],int l,int r,long x,long val)
    {
        int p=-1;
        while(l<=r)
        {
            int mid=(l+r)/2;
            if((a[mid]-val)<=x)
            {
                p=mid;
                l=mid+1;
            }
            else
                r=mid-1;
        }
        return p;
    }
    long M=998244353;
    long fact[];
    void fac(int n)
    {
        fact[1]=1;
        for(int i=2;i<=n;i++)
            fact[i]=(fact[i-1]%M*i%M)%M;
    }
    public static void main(String args[])throws Exception
    {
        new Thread(null,new templ(),"templ",1<<27).start();
    }
    public void run()
    {
        try
        {
            InputReader in = new InputReader(System.in);
            PrintWriter out = new PrintWriter(System.out);
            int n=in.ni();
            fact=new long[n+1];
            long a[]=new long[n+1];
            long b[]=new long[n+1];
            fac(n);
            a[1]=1;
            b[1]=1;
            for(int i=2;i<=n;i++)
            {
                a[i]=(fact[i-1]%M+(b[i-1]-1)%M)%M;
                b[i]=(i%M*a[i]%M)%M;
            }
            out.println(b[n]%M);
            out.close();
        }
        catch(Exception e){
            return;
        }
    }
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int ni() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nl() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }
}