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 ≤ 4 ⋅ 10^6; 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


Input


787788 100000007


Output


94810539

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.util.*;
import java.io.*;
public class Sol{
 
/*   
->check n=1, int overflow , array bounds , all possibilites(dont stuck on 1 approach)
->Problem = Observation(constraints(m<=n/3 or k<=min(100,n)) 
           + Thinking + Technique (seg_tree,binary lift,rmq,bipart,dp,connected comp etc)
->solve or leave it (- tutorial improves you in minimal way -)
*/
 
public static void main (String []args) {
//precomp();
 
int times=1;while(times-->0){solve();}out.close();}

//dp[n]= (dp[1]+dp[2] .. dp[n-1] )+dp[n/2]+dp[n/3]+dp[n/4]+.. dp[n/n];
//dp[n]= ( p[n-1] ) + ( q[n-1]+dp[n/r]-dp[(n-1)/r] n%r==0) O(nsqrt(n))

static int sieve[];

static void solve(){
  int n=ni();mod=ni();
  long dp[]=new long[n+5];
  dp[1]=1;dp[2]=2;for(int i=4;i<=n;i+=2){dp[i]++;}
  for(int i=3;i<=n;i++){
     dp[i]+=dp[i-1];dp[i]+=dp[i-1];dp[i]+=1;dp[i]%=mod;
     for(int j=2*i;j<=n;j+=i){
         dp[j]+=dp[i]-dp[i-1]+mod;dp[j]%=mod;
     }
  }
  out.println(dp[n]);
}

//-----------------Utility--------------------------------------------

static long gcd(long a,long b){if(b==0)return a; return gcd(b,a%b);}
 
static int Max=Integer.MAX_VALUE; static long mod=1000000007;
 
//static int v(char c){return (int)(c-'a');}
 
public static long power(long x, long y )
    {
        //0^0 = 1
        long res = 1L;
        x = x%mod;
        while(y > 0)
        {
            if((y&1)==1)
                res = (res*x)%mod;
            y >>= 1;
            x = (x*x)%mod;
        }
        return res;
    }
 
static class Pair implements Comparable<Pair>{
        int id;int value;Pair next;
        public Pair(int id,int value) {
         
          this.id=id;this.value=value;next=null;
        }
        @Override
        public int compareTo(Pair p){return Long.compare(value,p.value);}
    }

 
//----------------------I/O---------------------------------------------
 
static InputStream inputStream = System.in;
static OutputStream outputStream = System.out;
static FastReader in=new FastReader(inputStream);
static PrintWriter out=new PrintWriter(outputStream);
 
static class FastReader 
{ 
  BufferedReader br; 
  StringTokenizer st; 
 
        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
 
  public String next() 
  { 
      while (st == null || !st.hasMoreElements()) 
      { 
          try
          { 
              st = new StringTokenizer(br.readLine()); 
          } 
          catch (IOException  e) 
          { 
              e.printStackTrace(); 
          } 
      } 
      return st.nextToken(); 
  } 
 
  public int nextInt() 
  { 
      return Integer.parseInt(next()); 
  } 
 
  public long nextLong() 
  { 
      return Long.parseLong(next()); 
  } 
 
 public  double nextDouble() 
  { 
      return Double.parseDouble(next()); 
  } 
 
 
  String nextLine() 
  { 
      String str = ""; 
      try
      { 
          str = br.readLine(); 
      } 
      catch (IOException e) 
      { 
          e.printStackTrace(); 
      } 
      return str; 
  } 
}
//Only for Integer Input
/*static int ni() {
        try {
            boolean in = false;
            int res = 0;
            for (;;) {
                int b = System.in.read() - '0';
                if (b >= 0) {
                    in = true;
                    res = 10 * res + b;
                }
                else if (in)
                    return res;
            }
        } catch (IOException e) {
            throw new Error(e);
        }
    }*/
static int ni(){return in.nextInt();}
static long nl(){return in.nextLong();}
static double nd(){return in.nextDouble();}
static String ns(){return in.nextLine();}
}