#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const int maxk = 225;
long long s[maxk], c[maxk][maxk];
inline long long nml(long long a) { return ((a % M) + M) % M; }
void exgcd(long long a, long long& x, long long b, long long& y, long long& g) {
  if (b) {
    exgcd(b, y, a % b, x, g);
    y -= a / b * x;
  } else {
    x = 1;
    y = 0;
    g = a;
  }
}
inline long long inv(long long a) {
  long long x, y, g;
  exgcd(M, x, a, y, g);
  return nml(y);
}
inline long long add(long long a, long long b) {
  return (a += b) >= M ? a - M : a;
}
inline long long sub(long long a, long long b) {
  return (a -= b) < 0 ? a + M : a;
}
inline long long mul(long long a, long long b) { return a * b % M; }
inline long long _div(long long a, long long b) { return mul(a, inv(b)); }
inline long long mns(long long a) { return M - a; }
struct mll {
  long long a, b;
  mll(long long x, long long y) : a(x), b(y) {}
  mll operator+(long long x) { return mll(add(a, x), b); }
  mll operator-(long long x) { return mll(sub(a, x), b); }
  mll operator*(long long x) { return mll(mul(a, x), mul(b, x)); }
  mll operator/(long long x) {
    x = inv(x);
    return *this * x;
  }
  mll operator+(mll x) { return mll(add(a, x.a), add(b, x.b)); }
  mll operator-(mll x) { return mll(sub(a, x.a), sub(b, x.b)); }
  mll operator*(mll x) {
    return mll(add(mul(a, x.a), mul(5, mul(b, x.b))),
               add(mul(a, x.b), mul(b, x.a)));
  }
  mll operator/(mll x) {
    long long v = sub(mul(x.a, x.a), mul(5, mul(x.b, x.b)));
    return *this * mll(x.a, mns(x.b)) / v;
  }
  mll operator*=(mll x) { return *this = *this * x; }
  mll operator+=(mll x) { return *this = *this + x; }
  mll operator/=(long long x) { return *this = *this / x; }
  bool operator!=(long long x) { return b || a != x; }
};
mll operator*(long long x, mll y) { return y * x; }
mll operator/(long long x, mll y) { return mll(x, 0) / y; }
void precalc(long long k) {
  s[1] = 1;
  for (long long i = 2; i <= k; ++i)
    for (long long j = i; j >= 1; --j)
      s[j] = add(mul(mns(i - 1), s[j]), s[j - 1]);
  for (long long i = 1; i <= k; ++i) {
    c[i][0] = c[i][i] = 1;
    for (long long j = 1; j < i; ++j)
      c[i][j] = add(c[i - 1][j], c[i - 1][j - 1]);
  }
}
mll qpow(mll a, long long x) {
  long long sig = x < 0 ? -1 : 1;
  x *= sig;
  mll ret(1, 0);
  for (; x; x >>= 1, a *= a)
    if (x & 1) ret *= a;
  return (sig > 0) ? ret : (1 / ret);
}
int main() {
  long long k, l, r;
  scanf("%lld%lld%lld", &k, &l, &r);
  {
    int a = 0, b = 1, i = 1;
    for (; b < k; ++i, b += a, a = b - a)
      ;
    if (l + 2 < i) l = i - 2;
    if (r < l) {
      puts("0");
      return 0;
    }
  }
  precalc(k);
  mll isr5 = 1 / mll(0, 1);
  mll p = mll(1, 1) / 2;
  mll ip = 1 / p;
  mll p2 = p * p;
  mll pr3 = qpow(p, r + 3);
  mll pl2 = qpow(p, l + 2);
  mll ipr3 = 1 / pr3;
  mll ipl2 = 1 / pl2;
  mll pr3_2 = pr3 * pr3;
  mll pl2_2 = pl2 * pl2;
  mll rng(nml(r - l + 1), 0);
  mll ans(0, 0);
  mll v1 = isr5;
  mll v2 = ip;
  mll v3 = ipr3;
  mll v4 = ipl2;
  for (long long j = 1; j <= k;
       ++j, v1 *= isr5, v2 *= ip, v3 *= ipr3, v4 *= ipl2) {
    mll sum(0, 0);
    long long ne = (j & 1) ? mns(1) : 1;
    mll vv2 = v2;
    mll vv3 = v3;
    mll vv4 = v4;
    for (long long m = 0; m <= j;
         ++m, ne = mul(ne, mns(1)), vv2 *= p2, vv3 *= pr3_2, vv4 *= pl2_2) {
      mll q = ne * vv2;
      mll qr3 = (((r + 3) & 1) ? ne : 1) * vv3;
      mll ql2 = (((l + 2) & 1) ? ne : 1) * vv4;
      sum += mul(ne, c[j][m]) * (q != 1 ? (qr3 - ql2) / (q - 1) : rng);
    }
    ans += s[j] * v1 * sum;
  }
  long long ik = 1;
  for (long long i = 1; i <= k; ++i) ik = mul(ik, i);
  printf("%lld\n", _div(ans.a, ik));
}
