Recall that the permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation (n=3 but there is 4 in the array).

A sequence a is a subsegment of a sequence b if a can be obtained from b by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. We will denote the subsegments as [l, r], where l, r are two integers with 1 ≤ l ≤ r ≤ n. This indicates the subsegment where l-1 elements from the beginning and n-r elements from the end are deleted from the sequence.

For a permutation p_1, p_2, …, p_n, we define a framed segment as a subsegment [l,r] where max\\{p_l, p_{l+1}, ..., p_r\} - min\\{p_l, p_{l+1}, ..., p_r\} = r - l. For example, for the permutation (6, 7, 1, 8, 5, 3, 2, 4) some of its framed segments are: [1, 2], [5, 8], [6, 7], [3, 3], [8, 8]. In particular, a subsegment [i,i] is always a framed segments for any i between 1 and n, inclusive.

We define the happiness of a permutation p as the number of pairs (l, r) such that 1 ≤ l ≤ r ≤ n, and [l, r] is a framed segment. For example, the permutation [3, 1, 2] has happiness 5: all segments except [1, 2] are framed segments.

Given integers n and m, Jongwon wants to compute the sum of happiness for all permutations of length n, modulo the prime number m. Note that there exist n! (factorial of n) different permutations of length n.

Input

The only line contains two integers n and m (1 ≤ n ≤ 250 000, 10^8 ≤ m ≤ 10^9, m is prime).

Output

Print r (0 ≤ r < m), the sum of happiness for all permutations of length n, modulo a prime number m.

Examples

Input


1 993244853


Output


1


Input


2 993244853


Output


6


Input


3 993244853


Output


32


Input


2019 993244853


Output


923958830


Input


2020 437122297


Output


265955509

Note

For sample input n=3, let's consider all permutations of length 3:

  * [1, 2, 3], all subsegments are framed segment. Happiness is 6. 
  * [1, 3, 2], all subsegments except [1, 2] are framed segment. Happiness is 5. 
  * [2, 1, 3], all subsegments except [2, 3] are framed segment. Happiness is 5. 
  * [2, 3, 1], all subsegments except [2, 3] are framed segment. Happiness is 5. 
  * [3, 1, 2], all subsegments except [1, 2] are framed segment. Happiness is 5. 
  * [3, 2, 1], all subsegments are framed segment. Happiness is 6. 



Thus, the sum of happiness is 6+5+5+5+5+6 = 32.
#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
const long long INF = numeric_limits<long long>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926535898;
const long long LIM = 100005;
long long fpow(long long x, long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = fpow(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void sieve(long long n) {
  bool prime[5 * LIM];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++)
    if (prime[p] == true)
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
  prime[1] = 0;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
map<long long, long long> primeFactors(long long n) {
  map<long long, long long> mp;
  while (n % 2 == 0) {
    if (mp.count(2) == 1)
      mp[2]++;
    else
      mp.insert({2, 1});
    n = n / 2;
  }
  for (long long i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      if (mp.count(i) == 1)
        mp[i]++;
      else
        mp.insert({i, 1});
      n = n / i;
    }
  }
  if (n > 2) {
    if (mp.count(n) == 1)
      mp[n]++;
    else
      mp.insert({n, 1});
  }
  return mp;
}
bool visited[26];
string ans = "";
map<char, set<long long>> mp;
void dfs(char x) {
  ans += x;
  set<long long> s = mp[x];
  visited[x - 'a'] = true;
  for (auto itr = s.begin(); itr != s.end(); itr++) {
    if (visited[*itr - 'a'] == false) dfs(*itr);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, ans = 0;
  cin >> n >> m;
  vector<long long> fac(n + 1, 1);
  for (long long i = 1; i <= n; i++) {
    fac[i] = (fac[i - 1] * i) % m;
  }
  for (long long size = 1; size <= n; size++) {
    ans = (ans + ((((((n - size + 1) * fac[size]) % m) * fac[n - size]) % m) *
                  (n - size + 1)) %
                     m) %
          m;
  }
  cout << ans;
  return 0;
}
