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.
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _dbg(char const *s, const T &t) {
  cout << s << "=" << t << endl;
}
template <typename T, typename... TA>
void _dbg(char const *s, const T &t, const TA &...ta) {
  while (*s != ',') cout << *s++;
  cout << "=" << t << ",";
  _dbg(s + 1, ta...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream &print_iterable(ostream &os, T beg, T end) {
  os << '[';
  for (auto it = beg; it != end; ++it) {
    if (it != beg) os << ", ";
    os << *it;
  }
  return os << ']';
}
template <typename T, size_t N>
ostream &operator<<(ostream &os, const array<T, N> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &x) {
  return print_iterable(os, x.begin(), x.end());
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const unordered_map<T1, T2> &x) {
  return print_iterable(os, x.begin(), x.end());
}
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
const int mod = 998244353;
const int maxn = 1e6 + 10;
int stupid(int n) {
  vector<int> p(n);
  vector<int> as;
  iota((p).begin(), (p).end(), 1);
  do {
    for (auto &x : p) as.push_back(x);
  } while (next_permutation((p).begin(), (p).end()));
  ;
  int res = 0;
  for (int i = 0; i < (int)as.size(); ++i) {
    int j = i + n;
    if (j > (int)as.size()) break;
    int t = 0;
    for (int k = i; k < j; ++k) t += as[k];
    if (2 * t == n * (n + 1)) res++;
  }
  return res;
}
ll mul(ll a, ll b) { return a * b % mod; }
ll binpow(ll a, ll n) {
  if (n == 0) return 1;
  ll x = binpow(a, n / 2);
  x = mul(x, x);
  if (n & 1ll) x = mul(x, a);
  return x;
}
ll rev(ll a) { return binpow(a, mod - 2); }
ll fac[maxn];
ll C(int n, int k) { return mul(fac[n], rev(mul(fac[k], fac[n - k]))); }
void solve() {
  fac[0] = 1;
  for (int i = 1; i < maxn; ++i) fac[i] = mul(fac[i - 1], i);
  int n;
  cin >> n;
  ll res = fac[n];
  ;
  for (int p = 1; p < n; ++p) {
    ll a = fac[p];
    ll b = C(n, p);
    ll c = fac[n - p] - 1;
    ll e = mul(mul(a, b), mul(c, 1));
    ;
    res += e;
    res %= mod;
  };
  cout << res << endl;
}
int main() {
  solve();
  return 0;
}
