human
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.

def
assistant
#Here is Python code to 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.
naiveSolve():
    
    
    
    return


def solve():
    
    
    
    return


def main():
    
    n,MOD=readIntArr()
    
    def addAcrossRange(l,r,val):
        diffArr[l]+=val
        diffArr[l]%=MOD
        diffArr[r+1]-=val
        diffArr[r+1]=(diffArr[r+1]+MOD)%MOD
    def getVal(i):
        return diffArr[i]-diffArr[i-1]
    
    diffArr=[0]*(n+5)
    arr=[0]*(n+5)
    diffArr[1]=1
    diffArr[2]=-1
    arr[1]=1
    currVal=0
    prefixSum=0
    
    
    # nlogn solution
    
    for i in range(1,n+1):
        currVal+=diffArr[i]
        currVal%=MOD
        
        arr[i]=currVal
        prefixSum+=arr[i]
        prefixSum%=MOD
        addAcrossRange(i+1,i+1,prefixSum) # for the subtraction (y) cases

        
        # arr[i] contributes to arr[i*z] to arr[i*z+z-1] for all z>=1. avoid adding for i==i.
        z=1 # for the floor divide (z) cases
        while True:
            left=i*z
            if z==1:
                left+=1
            right=i*z+z-1
            right=min(right,n)
            if left>n:
                break
            addAcrossRange(left,right,arr[i])

            z+=1
        
    
    ans=arr[n]
    print(ans)
    
    
    return


import sys
# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.

def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))
 
def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]
 
def makeArr(defaultValFactory,dimensionArr): # eg. makeArr(lambda:0,[n,m])
    dv=defaultValFactory;da=dimensionArr
    if len(da)==1:return [dv() for _ in range(da[0])]
    else:return [makeArr(dv,da[1:]) for _ in range(da[0])]
 
def queryInteractive(x):
   ...