Problem: Test data generation is not an easy task! Often, generating big random test cases is not enough to ensure thorough testing of solutions for correctness.

For example, consider a problem from an old Codeforces round. Its input format looks roughly as follows:

The first line contains a single integer n (1 ≤ n ≤ maxn) — the size of the set. The second line contains n distinct integers a1, a2, ..., an (1 ≤ ai ≤ maxa) — the elements of the set in increasing order.

If you don't pay attention to the problem solution, it looks fairly easy to generate a good test case for this problem. Let n = maxn, take random distinct ai from 1 to maxa, sort them... Soon you understand that it's not that easy.

Here is the actual problem solution. Let g be the greatest common divisor of a1, a2, ..., an. Let x = an / g - n. Then the correct solution outputs "Alice" if x is odd, and "Bob" if x is even.

Consider two wrong solutions to this problem which differ from the correct one only in the formula for calculating x.

The first wrong solution calculates x as x = an / g (without subtracting n).

The second wrong solution calculates x as x = an - n (without dividing by g).

A test case is interesting if it makes both wrong solutions output an incorrect answer.

Given maxn, maxa and q, find the number of interesting test cases satisfying the constraints, and output it modulo q.

Input

The only line contains three integers maxn, maxa and q (1 ≤ maxn ≤ 30 000; maxn ≤ maxa ≤ 109; 104 ≤ q ≤ 105 + 129).

Output

Output a single integer — the number of test cases which satisfy the constraints and make both wrong solutions output an incorrect answer, modulo q.

Examples

Input

3 6 100000


Output

4


Input

6 21 100129


Output

154


Input

58 787788 50216


Output

46009

Note

In the first example, interesting test cases look as follows: 
    
    
      
    1              1              1              3  
    2              4              6              2 4 6  
    

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 120000 + 10;
const double PI = acos(-1);
pair<double, double> operator+(pair<double, double> a, pair<double, double> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
pair<double, double> operator-(pair<double, double> a, pair<double, double> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
pair<double, double> operator*(pair<double, double> a, pair<double, double> b) {
  return make_pair(a.first * b.first - a.second * b.second,
                   a.first * b.second + a.second * b.first);
}
pair<double, double> operator/(pair<double, double> a, double t) {
  return make_pair(a.first / t, a.second / t);
}
int rev[N], lim;
pair<double, double> w[N];
void initrever(int n, int &lim) {
  lim = 1;
  for (; lim < n; lim <<= 1)
    ;
  for (int i = 1; i < lim; i++) {
    rev[i] = (rev[i >> 1] >> 1);
    if (i & 1) rev[i] |= (lim >> 1);
  }
  for (int i = 0; i < lim; i++) {
    double t = 2 * PI * i / lim;
    w[i] = make_pair(cos(t), sin(t));
  }
  return;
}
void FFT(vector<pair<double, double> > &a, int t) {
  int lim = a.size();
  if (t < 0) {
    for (int i = 1; i < lim; i++) {
      if (i < (lim - i)) swap(a[i], a[lim - i]);
    }
  }
  for (int i = 0; i < lim; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 2; i <= lim; i <<= 1) {
    for (int j = 0; j < lim; j += i) {
      for (int k = 0; k < (i >> 1); k++) {
        pair<double, double> first = a[j + k],
                             second = a[j + k + (i >> 1)] * w[lim / i * k];
        a[j + k] = (first + second);
        a[j + k + (i >> 1)] = (first - second);
      }
    }
  }
  if (t < 0) {
    for (int i = 0; i < lim; i++) a[i] = a[i] / lim;
  }
  return;
}
vector<pair<double, double> > f[2];
int n, a, p;
double reduce(double first) {
  long long tmp = llround(first);
  tmp %= p;
  return (double)tmp;
}
void add1() {
  swap(f[0], f[1]);
  for (int i = 0; i <= 1; i++) {
    for (int j = n; j >= 1; j--) {
      f[i][j].first = reduce(f[i][j].first + f[i][j - 1].first);
    }
  }
  f[1][1].first = reduce(f[1][1].first + 1);
  return;
}
void put(vector<pair<double, double> > v) {
  for (int i = 0; i < (int)v.size(); i++) printf("%lf ", v[i].first);
  printf("\n");
  return;
}
void pro2(int v) {
  FFT(f[0], 1), FFT(f[1], 1);
  for (int i = 0; i < lim; i++) {
    pair<double, double> first =
        f[v & 1][i] * (f[0][i] + f[1][i]) + f[0][i] + f[v & 1][i];
    pair<double, double> second =
        f[(v & 1) ^ 1][i] * (f[0][i] + f[1][i]) + f[1][i] + f[(v & 1) ^ 1][i];
    f[0][i] = first, f[1][i] = second;
  }
  FFT(f[0], -1), FFT(f[1], -1);
  for (int i = 0; i <= 1; i++) {
    for (int j = 0; j <= n; j++) {
      f[i][j].first = reduce(f[i][j].first);
      f[i][j].second = 0;
    }
    for (int j = n + 1; j < lim; j++) f[i][j] = make_pair(0, 0);
  }
  return;
}
vector<int> num;
int main() {
  scanf("%d%d%d", &n, &a, &p);
  initrever(n * 2 + 1, lim);
  f[0].resize(lim), f[1].resize(lim);
  for (int no = a; no > 1; no /= 2) {
    num.push_back(no);
  }
  num.push_back(1);
  reverse(num.begin(), num.end());
  f[1][1].first = 1;
  int ans = 0;
  for (int i = 0; i < (int)num.size() - 1; i++) {
    for (int j = 1; j <= n; j += 2) {
      ans = (ans + llround(f[1][j].first)) % p;
    }
    pro2(num[i]);
    if (num[i] * 2 < num[i + 1]) add1();
  }
  printf("%d\n", ans);
  return 0;
}