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;
template <typename T>
void pfill(T* pst, const T* ped, T val) {
  for (; pst != ped; *(pst++) = val)
    ;
}
template <typename T, typename Tv>
void pcopy(T* pst, const T* ped, Tv* pval) {
  for (; pst != ped; *(pst++) = *(pval++))
    ;
}
const int N = 65536;
const int bzmax = 18;
void exgcd(int a, int b, int& x, int& y) {
  if (!b) {
    x = 1, y = 0;
  } else {
    exgcd(b, a % b, y, x);
    y -= (a / b) * x;
  }
}
int inv(int a, int Mod) {
  int x, y;
  exgcd(a, Mod, x, y);
  return (x < 0) ? (x + Mod) : (x);
}
template <const int Mod>
class Z {
 public:
  int v;
  Z() : v(0) {}
  Z(int v) : v(v) {}
  Z(long long x) : v(x % Mod) {}
  Z operator+(Z b) {
    int x = v + b.v;
    return Z((x >= Mod) ? (x - Mod) : (x));
  }
  Z operator-(Z b) {
    int x = v - b.v;
    return Z((x < 0) ? (x + Mod) : (x));
  }
  Z operator*(Z b) { return Z(1ll * v * b.v); }
  Z operator~() { return inv(v, Mod); }
  Z operator-() { return Z(0) - *this; }
  Z& operator+=(Z b) { return *this = *this + b; }
  Z& operator-=(Z b) { return *this = *this - b; }
  Z& operator*=(Z b) { return *this = *this * b; }
};
template <typename Zi>
Zi qpow(Zi a, int p, int Mod) {
  if (p < Mod - 1) p += Mod - 1;
  Zi rt = 1, pa = a;
  for (; p; p >>= 1, pa = pa * pa) {
    if (p & 1) {
      rt = rt * pa;
    }
  }
  return rt;
}
template <typename Zi, const int Mod, const int g>
class NTT {
 private:
  Zi gn[bzmax + 4], _gn[bzmax + 4];

 public:
  NTT() {
    for (int i = 0; i <= bzmax; i++) {
      gn[i] = qpow(Zi(g), (Mod - 1) >> i, Mod);
      _gn[i] = qpow(Zi(g), -((Mod - 1) >> i), Mod);
    }
  }
  void operator()(Zi* f, int len, int sgn) {
    for (int i = 1, j = len >> 1, k; i < len - 1; i++, j += k) {
      if (i < j) swap(f[i], f[j]);
      for (k = len >> 1; k <= j; j -= k, k >>= 1)
        ;
    }
    Zi *wn = (sgn > 0) ? (gn + 1) : (_gn + 1), w, a, b;
    for (int l = 2, hl; l <= len; l <<= 1, wn++) {
      hl = l >> 1, w = 1;
      for (int i = 0; i < len; i += l, w = 1) {
        for (int j = 0; j < hl; j++, w *= *wn) {
          a = f[i + j], b = f[i + j + hl] * w;
          f[i + j] = a + b;
          f[i + j + hl] = a - b;
        }
      }
    }
    if (sgn < 0) {
      Zi invlen = ~Zi(len);
      for (int i = 0; i < len; i++) {
        f[i] *= invlen;
      }
    }
  }
  int correct_len(int len) {
    int m = 1;
    for (; m <= len; m <<= 1)
      ;
    return m;
  }
};
const int Mod1 = 998244353, Mod2 = 1004535809;
const long long Mall = 1ll * Mod1 * Mod2;
NTT<Z<Mod1>, Mod1, 3> NTT1;
NTT<Z<Mod2>, Mod2, 3> NTT2;
int n, M, Mod;
vector<int> operator+(vector<int> a, vector<int> b) {
  if (a.size() < b.size()) a.resize(b.size());
  for (int i = 0; i < (signed)b.size(); i++) {
    a[i] += b[i];
    (a[i] >= Mod) && (a[i] -= Mod);
  }
  return a;
}
vector<int> operator*(vector<int> a, vector<int> b) {
  int n = a.size(), m = b.size();
  int k = n + m - 1;
  if (n < 40 || m < 40) {
    vector<long long> ret(k);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        ret[i + j] += a[i] * b[j];
      }
    }
    for (auto& x : ret) x %= Mod;
    vector<int> rt(k);
    pcopy(rt.data(), rt.data() + k, ret.data());
    return rt;
  }
  int t = NTT1.correct_len(k);
  vector<Z<Mod1> > a1(t), b1(t);
  vector<Z<Mod2> > a2(t), b2(t);
  pcopy(a1.data(), a1.data() + n, a.data());
  pcopy(a2.data(), a2.data() + n, a.data());
  pcopy(b1.data(), b1.data() + m, b.data());
  pcopy(b2.data(), b2.data() + m, b.data());
  NTT1(a1.data(), t, 1);
  NTT1(b1.data(), t, 1);
  NTT2(a2.data(), t, 1);
  NTT2(b2.data(), t, 1);
  for (int i = 0; i < t; i++) a1[i] = a1[i] * b1[i];
  for (int i = 0; i < t; i++) a2[i] = a2[i] * b2[i];
  NTT1(a1.data(), t, -1);
  NTT2(a2.data(), t, -1);
  a.resize(k);
  long long inv1 = inv(Mod1 % Mod2, Mod2), inv2 = inv(Mod2 % Mod1, Mod1);
  for (int i = 0; i < k; i++) {
    a[i] = ((1ll * a1[i].v * inv2 % Mod1 * Mod2 +
             1ll * a2[i].v * inv1 % Mod2 * Mod1) %
            Mall) %
           Mod;
  }
  return a;
}
vector<int>& fix(vector<int>& p, int size) {
  p.resize(size);
  return p;
}
int main() {
  scanf("%d%d%d", &n, &M, &Mod);
  n++;
  vector<int> f0, f1, g0, g1, g;
  f0.resize(n), f1.resize(n);
  f0[0] = 1, f1[0] = 1;
  long long ans = 0;
  int q = 29;
  while (!(M >> q)) q--;
  for (; q; q--) {
    g0 = f0, g1 = f1, g = g0 + g1;
    g[0] = 1;
    if (!((M >> (q + 1)) & 1)) {
      f0 = f0 * g, f1 = f1 * g;
      fix(f0, n), fix(f1, n);
    } else {
      f0 = g1 * g, f1 = g0 * g;
      fix(f0, n), fix(f1, n);
    }
    for (int i = 1; i <= n; i++) {
      f0[i] -= g1[i];
      f1[i] -= g0[i];
      (f0[i] < 0) && (f0[i] += Mod);
      (f1[i] < 0) && (f1[i] += Mod);
    }
    if ((M >> q) & 1) {
      for (int i = n; i; i--) {
        f1[i] += f0[i - 1] + f1[i - 1] - (i == 1);
        f1[i] %= Mod;
      }
    }
    for (int i = 1; i < n; i += 2) {
      ans += f1[i];
    }
  }
  ans %= Mod;
  printf("%d\n", (int)ans);
  return 0;
}