This version of the problem differs from the next one only in the constraint on n.

Note that the memory limit in this problem is lower than in others.

You have a vertical strip with n cells, numbered consecutively from 1 to n from top to bottom.

You also have a token that is initially placed in cell n. You will move the token up until it arrives at cell 1.

Let the token be in cell x > 1 at some moment. One shift of the token can have either of the following kinds: 

  * Subtraction: you choose an integer y between 1 and x-1, inclusive, and move the token from cell x to cell x - y. 
  * Floored division: you choose an integer z between 2 and x, inclusive, and move the token from cell x to cell ⌊ x/z ⌋ (x divided by z rounded down). 



Find the number of ways to move the token from cell n to cell 1 using one or more shifts, and print it modulo m. Note that if there are several ways to move the token from one cell to another in one shift, all these ways are considered distinct (check example explanation for a better understanding).

Input

The only line contains two integers n and m (2 ≤ n ≤ 2 ⋅ 10^5; 10^8 < m < 10^9; m is a prime number) — the length of the strip and the modulo.

Output

Print the number of ways to move the token from cell n to cell 1, modulo m.

Examples

Input


3 998244353


Output


5


Input


5 998244353


Output


25


Input


42 998244353


Output


793019428

Note

In the first test, there are three ways to move the token from cell 3 to cell 1 in one shift: using subtraction of y = 2, or using division by z = 2 or z = 3.

There are also two ways to move the token from cell 3 to cell 1 via cell 2: first subtract y = 1, and then either subtract y = 1 again or divide by z = 2.

Therefore, there are five ways in total.
import java.io.*;
import java.util.*;

public class Main{
	static int mul(int x,int y,int mod){
		return (int)((x*1l*y)%mod);
	}
	static int add(int x,int y,int mod){
		int ans=x+y;
		if(ans>=mod)ans-=mod;
		return ans;
	}
	static void main() throws Exception{
		int n=sc.nextInt(),m=sc.nextInt();
		int[]ans=new int[n+1];
		int[]pref=new int[n+1];
		ans[1]=1;
		pref[1]=1;
		for(int i=2;i<=n;i++){
			for (int j = 1, la; j <= i; j = la + 1) {
				la = i / (i / j);
				//i / x yields the same value for j <= x <= la.
				ans[i]=add(ans[i],mul(ans[i/j],la-j+1,m),m);
			}
			ans[i]=add(ans[i],pref[i-1],m);
			pref[i]=add(ans[i],pref[i-1],m);
		}
		pw.println(ans[n]);
	}
	public static void main(String[] args) throws Exception{
		sc=new MScanner(System.in);
//		sc=new MScanner(".in");
		pw = new PrintWriter(System.out);
		int tc=1;
//        tc=sc.nextInt();
		for(curt=1;curt<=tc;curt++) {
//			pw.printf("Case #%d: ", i);
			main();
		}

		pw.flush();
	}
	static int curt;
	static PrintWriter pw;
	static MScanner sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
			int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
			return in;
		}
		public long[] longArr(int n) throws IOException {
			long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
			return in;
		}
		public int[] intSortedArr(int n) throws IOException {
			int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}
		public long[] longSortedArr(int n) throws IOException {
			long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
			shuffle(in);
			Arrays.sort(in);
			return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
			Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
			return in;
		}
		public Long[] LongArr(int n) throws IOException {
			Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
			return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}

	}
	static void dbg(int[]in) {
		System.out.println(Arrays.toString(in));
	}
	static void dbg(long[]in) {
		System.out.println(Arrays.toString(in));
	}
	static void sort(int[]in) {
		shuffle(in);
		Arrays.sort(in);
	}
	static void sort(long[]in) {
		shuffle(in);
		Arrays.sort(in);
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}