#include <bits/stdc++.h>
using namespace std;
int n;
long long m;
long long f[200005];
int main() {
  scanf("%d%lld", &n, &m);
  long long sum = 1;
  f[1] = 1;
  for (int i = 2; i <= n; i++) {
    f[i] = (f[i] + sum) % m;
    for (long long l = 2, r; l <= i; l = r + 1) {
      r = min((long long)i, i / (i / l));
      f[i] = (f[i] + (r - l + 1) * f[i / l] % m) % m;
    }
    sum = (f[i] + sum) % m;
  }
  printf("%lld\n", f[n]);
  return 0;
}
