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

//1, 20, 39, 58, 96, 153, 210, 324, 66
// 20 - 1, 12, 34, 45, 100, 210
// 28 - 1, 16, 46, 91, 196, 406
public class Main {


    static int MOD = 998244353;

    public static void main(String[] args)  {
        Reader reader = new Reader(System.in);
        int n = reader.nextInt();
        long fact[] = new long[n + 1];
        fact[1] = 1;
        for (int i = 2;i <= n; ++i) {
            fact[i] = (fact[i - 1] * i);
            fact[i] %= MOD;
        }
        long ans = fact[n];
        long mul = n;
        for (int i = n - 1;i >= 2; --i) {
            ans += (mul * (fact[i] - 1));
            ans %= MOD;
            mul *= i;
            mul %= MOD;
        }
        System.out.println(ans);
    }

    private static long fact(final long n) {
        long ans = 1;
        for (long i = 2;i <= n; ++i) {
            ans *= i;
            ans %= MOD;
        }
        return ans;
    }

    private static void merge(final int[] rank, final int[] parent, final int pu, final int pv) {
        if (pu != pv) {
            if (rank[pu] > rank[pv]) {
                parent[pv] = pu;
                rank[pu] += rank[pv];
             } else {
                parent[pu] = pv;
                rank[pv] += rank[pu];
            }
        }
    }

    private static int parent(final int[] parent, int u) {
        while (parent[u] != u) {
            parent[u] = parent[parent[u]];
            u = parent[u];
        }
        return parent[u];
    }

    static class Edge {
        final int u;
        final int v;
        final int weight;

        Edge(final int u, final int v, final int weight) {
            this.u = u;
            this.v = v;
            this.weight = weight;
        }
    }

    static class Pair implements Comparable<Pair>{

        final int a, b;

        Pair(int a, int b) {

            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {
            if (a == p.a) {
                return Integer.compare(b, p.b);
            } else {
                return Integer.compare(a, p.a);
            }
        }

        @Override
        public boolean equals(final Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            final Pair pair = (Pair) o;
            return a == pair.a &&
                    b == pair.b;
        }

        @Override
        public int hashCode() {
            return Objects.hash(a, b);
        }
    }

    static class Reader {
        private final BufferedReader br;
        private StringTokenizer tokenizer;

        Reader(InputStream in) {
            this.tokenizer = new StringTokenizer("");
            this.br = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            while (!tokenizer.hasMoreTokens()) {
                String st = nextLine();
                if (st != null) tokenizer = new StringTokenizer(st);
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }
    }
}