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;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x %= p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int searchll(long long int val, vector<long long int>& vec) {
  for (long long int i = 0; i < vec.size(); i++) {
    if (vec[i] == val) {
      return i;
    }
  }
  return -1;
}
bool isPrime(long long int n) {
  int broken = 0;
  for (long long int i = 2; i < sqrt(n) + 1; i++) {
    if (n % i == 0) {
      broken = 1;
      break;
    }
  }
  if (broken == 1) {
    return false;
  } else {
    return true;
  }
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
vector<bool> SieveOfEratosthenes(long long int num) {
  vector<bool> pno;
  pno.assign(num + 1, true);
  pno[0] = false;
  pno[1] = false;
  for (long long int i = 2; i * i <= num; i++) {
    if (pno[i] == true) {
      for (long long int j = i * 2; j <= num; j += i) pno[j] = false;
    }
  }
  return pno;
}
vector<long long int> SieveOfEratosthenesExtended(long long int num) {
  vector<long long int> pno(num + 1);
  for (long long int i = 0; i < num + 1; i++) {
    pno[i] = i;
  }
  for (long long int i = 2; i * i <= num; i++) {
    if (pno[i] == i) {
      for (long long int j = i * 2; j <= num; j += i)
        if (pno[j] == j) pno[j] = i;
    }
  }
  return pno;
}
vector<long long int> PrimeFactorize(long long int num) {
  vector<long long int> spf;
  spf = SieveOfEratosthenesExtended(num);
  set<long long int> pf;
  while (num != 1) {
    pf.insert(spf[num]);
    num = num / spf[num];
  }
  vector<long long int> v;
  for (auto it : pf) {
    v.push_back(it);
  }
  return v;
}
long long int calculateNcR(long long int n, long long int r) {
  long long int p = 1, k = 1;
  if (n - r < r) r = n - r;
  if (r != 0) {
    while (r) {
      p *= n;
      k *= r;
      long long int m = gcd(p, k);
      p /= m;
      k /= m;
      n--;
      r--;
    }
  } else
    p = 1;
  return p;
}
long long int stringToInt(string s) {
  long long int num = 0;
  for (long long int i = 0; i < s.length(); i++) {
    num = num * 10 + (s[i] - '0');
  }
  return num;
}
long long int BinarySearch(vector<long long int>& arr, long long int num) {
  long long int left = 0, right = arr.size(), mid;
  while (left < right) {
    mid = (left + right) / 2;
    if (arr[mid] == num) {
      return mid;
    } else if (arr[mid] < num) {
      left = mid + 1;
    } else {
      right = mid;
    }
  }
  return left;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int x = 1;
  long long int fact = 1;
  for (long long int i = 2; i < n + 1; i++) {
    x = (x + fact - 1) * i;
    fact *= i;
    x = (x % 998244353 + 998244353) % 998244353;
    fact = (fact % 998244353 + 998244353) % 998244353;
  }
  cout << x << "\n";
}
