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

public class Solution {
static class NumberTheoryUtils {
		private long MOD = (long)(1e9 + 7);
		long[]fact, inverseFact;
		boolean factsMade = false;
		public long gcd(long a, long b) {
			if(b == 0)return a;
			return gcd(b, a%b);
		}
		public int gcd(int a, int b) {
			if(b == 0)return a;
			return gcd(b, a%b);
		}
		public long lcd(long a, long b) {
			return a * b / gcd(a, b);
		}
		public int lcm(int a, int b) {
			return (int) 1L * a * b / gcd(a, b);
		}
		public int[] getLPFArray(int maxLength) {
			int[]lpf = new int[maxLength+5];
			for(int i=2; i<=maxLength; i++) {
				if(lpf[i] == 0) {
					for(int j=i; j<=maxLength; j+=i) {
						if(lpf[j] == 0) {
							lpf[j] = i;
						}
					}
				}
			}
			return lpf;
		}
		public boolean[]getSieve(int maxLength){
			boolean[]isPrime = new boolean[maxLength+5];
			Arrays.fill(isPrime, true);
			isPrime[0] = isPrime[1] = false;
			for(int i=2; i<=maxLength; i++) {
				if(isPrime[i]) {
					for(int j=2*i; j<=maxLength; j+=i) {
						if(isPrime[j]) {
							isPrime[j] = false;
						}
					}
				}
			}
			return isPrime;
		}
		public void setMod(long MOD) {
			this.MOD = MOD;
		}
		public long powerModulo(long base, long exponent) {
			if(exponent == 0)return 1L;
			long tempValue = powerModulo(base, exponent / 2L);
			long res = (tempValue * tempValue) % MOD;
			if(exponent % 2 != 0)res = (res * base) % MOD;
			return res;
		}
		public long inverseModulo(long value) {
			return this.powerModulo(value, MOD - 2L);
		}
		public long nCr(int n, int r) {
			if(n < r || n < 0 || r < 0)return 0L;
			return (((fact[n] * inverseFact[n-r]) % MOD) * inverseFact[r]) % MOD;
		}
		
		public long[]getFactorialsModulo(int maxLength){
			this.fact = new long[maxLength];
			fact[0] = 1L;
			for(int i=1; i<maxLength; i++) {
				fact[i] = (fact[i-1] * i) % MOD;
			}
			this.factsMade = true;
			return fact;
		}
		public long[]getInverseFactorialsModulo(int maxLength){
			this.inverseFact = new long[maxLength];
			if(!this.factsMade) {
				this.getFactorialsModulo(maxLength);
			}
			for(int i=0; i<maxLength; i++) {
				inverseFact[i] = this.inverseModulo(fact[i]);
			}
			return inverseFact;
		}
		public TreeMap<Integer, Integer> getPrimeFactors(long n){
			TreeMap<Integer, Integer> answer = new TreeMap<Integer, Integer>();
			int twoCount = 0;
			while(n % 2 == 0) {
				n /= 2;
				twoCount++;
			}
			if(twoCount > 0)answer.put(2, twoCount);
			for(int i=3; 1L*i*i<=n; i+=2) {
				int iCount = 0;
				while(n % i == 0) {
					n /= i;
					iCount++;
				}
				if(iCount > 0) {
					answer.put(i, iCount);
				}
			}
			return answer;
		}
		public long eulerTotientFunctionForSingleValue(long n) {
			// Complexity O(sqrt(n))
			long result = n;
			for(int i=2; 1L*i*i <= n; i++) {
				if(n % i == 0) {
					while(n % i == 0) {
						n /= i;
					}
					result -= result / i;
				}
			}
			if(n > 1) {
				result -= result / n;
			}
			return result;
		}
		public int[]eulerTotientFunctionForRange(int n){
			int[]phi = new int[n+1];
			for(int i=1; i<=n; i++) {
				phi[i] = i;
			}
			for(int i=2; i<=n; i++) {
				if(phi[i] == i) {
					for(int j=i; j<=n; j+=i) {
						phi[j] -= phi[j] / i;
					}
				}
			}
			return phi;
		}

	}

public static void main(String[] args){

   new Thread(null, null, "Anshum Gupta", 99999999) {
        public void run() {
            try {
                solve();
            } catch(Exception e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    }.start();
}
static final long mxx = (long)(1e18+5);
static final int mxN = (int)(1e6);
static final int mxV = (int)(5e5+1), log = 18;
static long mod = (long)(1e9+7); //998244353;//̇
static final int INF = (int)1e9;
static boolean[][]vis;
static ArrayList<ArrayList<Integer>> adj;
static int n, m, k, q, x, y;
static char[]str;
public static void solve() throws Exception {
	   // solve the problem here
		s = new MyScanner();
   		out = new PrintWriter(new BufferedOutputStream(System.out), true);
//	   		out = new PrintWriter("output.txt");
        int tc = 1;//s.nextInt();
        NumberTheoryUtils ntu = new NumberTheoryUtils();
        while(tc-- > 0){
        	n = s.nextInt();
        	long m = s.nextLong();
        	ntu.setMod(m);
        	long[]fact = ntu.getFactorialsModulo(n+1);
        	long ans = 0;
        	for(int length = 1; length <=n; length++) {
        		// 1 ... n+1-length
        		ans += (((((n+1-length) * fact[length])%m)*fact[n+1-length])%m) ;
        		ans %= m;
        	}
        	if(ans < 0) ans += m;
        	out.println(ans);
        } 
           
        out.flush();
        out.close();
}

public static PrintWriter out;
public static MyScanner s;
static class MyScanner {

    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    public MyScanner(String fileName) {
    	try {
			br = new BufferedReader(new FileReader(fileName));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
    }
    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() { return Integer.parseInt(next()); }
    long nextLong() { return Long.parseLong(next()); }
    double nextDouble() { return Double.parseDouble(next()); }
    int[] nextIntArray(int n){
    	int[]a = new int[n];
    	for(int i=0; i<n; i++) {
    		a[i] = this.nextInt();
    	}
    	return a;
    }
    long[] nextlongArray(int n) {
    	long[]a = new long[n];
    	for(int i=0; i<n; i++) {
    		a[i] = this.nextLong();
    	}
    	return a;
    }
    Integer[] nextIntegerArray(int n){
    	Integer[]a = new Integer[n];
    	for(int i=0; i<n; i++) {
    		a[i] = this.nextInt();
    	}
    	return a;
    }
    Long[] nextLongArray(int n) {
    	Long[]a = new Long[n];
    	for(int i=0; i<n; i++) {
    		a[i] = this.nextLong();
    	}
    	return a;
    }
    char[][] next2DCharArray(int n, int m){
    	char[][]arr = new char[n][m];
    	for(int i=0; i<n; i++) {
    		arr[i] = this.next().toCharArray();
    	}
    	return arr;
    }
    ArrayList<ArrayList<Integer>> readUndirectedUnweightedGraph(int n, int m) {
    	ArrayList<ArrayList<Integer>>adj = new ArrayList<ArrayList<Integer>>();
    	for(int i=0; i<=n; i++)adj.add(new ArrayList<Integer>());
    	for(int i=0; i<m; i++) {
    		int u = s.nextInt();
    		int v = s.nextInt();
    		adj.get(u).add(v);
    		adj.get(v).add(u);
    	}
    	return adj;
    }
    ArrayList<ArrayList<Integer>> readDirectedUnweightedGraph(int n, int m) {
    	ArrayList<ArrayList<Integer>>adj = new ArrayList<ArrayList<Integer>>();
    	for(int i=0; i<=n; i++)adj.add(new ArrayList<Integer>());
    	for(int i=0; i<m; i++) {
    		int u = s.nextInt();
    		int v = s.nextInt();
    		adj.get(u).add(v);
    	}
    	return adj;
    }
    String nextLine(){
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

 
}
