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.
# template begins
#####################################
from io import BytesIO, IOBase
import sys
import math
import os
import heapq
from collections import defaultdict, deque
from math import ceil
from bisect import bisect_left, bisect_left
from time import perf_counter


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip("\r\n")
def mint(): return map(int, input().split())
def mfloat(): return map(float, input().split())
def intin(): return int(input())


#####################################
# template ends
# Use the recursion snippet if heavy recursion is needed (depth>1000)
# If constraints are tight, use 1d arrays instead of 2d, like g[i*m+j] instead of g[i][j]
def solve():
    n, mod = map(int, input().split())
    dp = [0]*(n+1)
    dp[-1] = 1
    # brute force
    # for i in range(n, 1, -1):
    #     for j in range(1, i):
    #         dp[j] = (dp[j] + dp[i]) % mod
    #     for j in range(2, i+1):
    #         dp[i//j] = (dp[i] + dp[i//j]) % mod
    # print(dp[1])
    """
    2^(n-2) ways by addition alone? yes
    """
    # for i in range(n-1, 0, -1):
    #     by_addition = pow(2, n-i-1, mod)
    # print("power =", pow(2, n-2, mod))
    current = 1
    suffix_sum = [0]*(n+1)
    suffix_sum[-1] = 1
    for i in range(n-1, 0, -1):
        dp[i] = suffix_sum[i+1]
        # for j in range(2*i, n+1, i):
        #     dp[i] = (dp[i] + suffix_sum[j] -
        #              (suffix_sum[j+j] if j+j < n else 0))  # % mod
        #     break
        for j in range(2, n+1):
            if i*j > n:
                break
            dp[i] += suffix_sum[i*j] - (suffix_sum[i*j+j] if i*j+j <= n else 0)
            dp[i] %= mod
        suffix_sum[i] = (suffix_sum[i+1] + dp[i]) % mod
    # print(dp)
    # print(suffix_sum)
    print(dp[1] % mod)


def main():
    t = 1
    # t = int(input())
    for _ in range(t):
        solve()


if __name__ == "__main__":
    start_time = perf_counter()
    main()
    print(perf_counter()-start_time, file=sys.stderr)
