description: 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.
solution: import java.util.*;
  import java.io.*;
  
  public class D {
  
      public void prayGod() throws IOException {
          int n = nextInt(), m = nextInt();
  
          long[] dp = new long[n + 1];
          long[] pref = new long[n + 1];
          dp[1] = pref[1] = 1 % m;
  
          for (int i = 2; i <= n; i++) {
              dp[i] = pref[i - 1];
              int ptr = 2;
              while (ptr <= i) {
                  int maxBound = i / (i / ptr);
                  dp[i] += dp[i / ptr] * Math.max(maxBound - ptr + 1, 0) % m;
                  dp[i] %= m;
                  ptr = maxBound + 1;
              }
              pref[i] = (pref[i - 1] + dp[i]) % m;
          }
  
          out.println(dp[n]);
  
      }
  
      static final boolean RUN_TIMING = true;
      static final boolean AUTOFLUSH = false;
      static final boolean FILE_INPUT = false;
      static final boolean FILE_OUTPUT = false;
  
      static int iinf = 0x3f3f3f3f;
      static long inf = (long) 1e18 + 10;
      static long mod = 998244353L;
  
      static char[] inputBuffer = new char[1 << 20];
      static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1 << 20);
      static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), AUTOFLUSH);
  
      // int data-type
      public int nextInt() throws IOException {
          return Integer.parseInt(next());
      }
  
      public int[] nextIntArray(int n) throws IOException {
          int[] arr = new int[n];
          for (int i = 0; i < n; i++)
              arr[i] = nextInt();
          return arr;
      }
  
      public void sort(int[] a) {
          shuffle(a);
          Arrays.sort(a);
      }
  
      public static void printArray(int[] arr) {
          for (int i = 0; i < arr.length; i++)
              out.print(arr[i] + " ");
          out.println();
      }
  
      // long data-type
      public long nextLong() throws IOException {
          return Long.parseLong(next());
      }
  
      public long[] nextLongArray(int n) throws IOException {
          long[] arr = new long[n];
          for (int i = 0; i < n; i++)
              arr[i] = nextLong();
          return arr;
      }
  
      public static void printArray(long[] arr) {
          for (int i = 0; i < arr.length; i++)
              out.print(arr[i] + " ");
          out.println();
      }
  
      public void sort(long[] a) {
          shuffle(a);
          Arrays.sort(a);
      }
  
      // double data-type
      public double nextDouble() throws IOException {
          return Double.parseDouble(next());
      }
  
      public double[] nextDoubleArray(int n) throws IOException {
          double[] arr = new double[n];
          for (int i = 0; i < n; i++)
              arr[i] = nextDouble();
          return arr;
      }
  
      public static void printArray(double[] arr) {
          for (int i = 0; i < arr.length; i++)
              out.print(arr[i] + " ");
          out.println();
      }
  
      // Generic type
      public <T> void sort(T[] a) {
          shuffle(a);
          Arrays.sort(a);
      }
  
      public static <T> void printArray(T[] arr) {
          for (int i = 0; i < arr.length; i++)
              out.print(arr[i] + " ");
          out.println();
      }
  
      public String next() throws IOException {
          int len = 0;
          int c;
          do {
              c = in.read();
          } while (Character.isWhitespace(c) && c != -1);
          if (c == -1) {
              throw new NoSuchElementException("Reached EOF");
          }
          do {
              inputBuffer[len] = (char) c;
              len++;
              c = in.read();
          } while (!Character.isWhitespace(c) && c != -1);
          while (c != '\n' && Character.isWhitespace(c) && c != -1) {
              c = in.read();
          }
          if (c != -1 && c != '\n') {
              in.unread(c);
          }
          return new String(inputBuffer, 0, len);
      }
  
      public String nextLine() throws IOException {
          int len = 0;
          int c;
          while ((c = in.read()) != '\n' && c != -1) {
              if (c == '\r') {
                  continue;
              }
              inputBuffer[len] = (char) c;
              len++;
          }
          return new String(inputBuffer, 0, len);
      }
  
      public boolean hasNext() throws IOException {
          String line = nextLine();
          if (line.isEmpty()) {
              return false;
          }
          in.unread('\n');
          in.unread(line.toCharArray());
          return true;
      }
  
      public void shuffle(int[] arr) {
          int n = arr.length;
          for (int i = 0; i < n; i++) {
              int j = (int) (Math.random() * (n - i));
              int temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
  
      public void shuffle(long[] arr) {
          int n = arr.length;
          for (int i = 0; i < n; i++) {
              int j = (int) (Math.random() * (n - i));
              long temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
  
      public void shuffle(Object[] arr) {
          int n = arr.length;
          for (int i = 0; i < n; i++) {
              int j = (int) (Math.random() * (n - i));
              Object temp = arr[i];
              arr[i] = arr[j];
              arr[j] = temp;
          }
      }
  
      public static void main(String[] args) throws IOException {
          if (FILE_INPUT)
              in = new PushbackReader(new BufferedReader(new FileReader(new File("output.txt"))), 1 << 20);
          if (FILE_OUTPUT)
              out = new PrintWriter(new FileWriter(new File("output.txt")));
  
          long time = 0;
          time -= System.nanoTime();
          new D().prayGod();
          time += System.nanoTime();
  
          if (RUN_TIMING)
              System.err.printf("%.3f ms%n", time / 1000000.0);
  
          out.flush();
          in.close();
      }
  }