#include <bits/stdc++.h>
using namespace std;
const int P(1000000007);
int inc(int a, int b) { return a + b >= P ? a + b - P : a + b; }
long long mpower(long long a, long long b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return ret;
}
struct Num {
  int a, b;
  Num(void) {}
  Num(int a, int b) : a(a), b(b) {}
  Num inv(void) const {
    long long t = ((long long)a * a - 5LL * b % P * b) % P;
    if (t < 0) t += P;
    t = mpower(t, P - 2);
    return Num(a * t % P, (P - b) * t % P);
  }
} phi1(500000004, 500000004), phi2(500000004, 500000003);
Num operator+(const Num &a, const Num &b) {
  return Num(inc(a.a, b.a), inc(a.b, b.b));
}
Num operator-(const Num &a, const Num &b) {
  return Num(inc(a.a, P - b.a), inc(a.b, P - b.b));
}
Num operator*(const Num &a, const Num &b) {
  return Num(((long long)a.a * b.a + 5LL * a.b % P * b.b) % P,
             ((long long)a.a * b.b + (long long)a.b * b.a) % P);
}
Num operator/(const Num &a, const Num &b) { return a * b.inv(); }
Num mpower(Num a, long long b) {
  Num ret(1, 0);
  while (b) {
    if (b & 1) ret = ret * a;
    a = a * a;
    b >>= 1;
  }
  return ret;
}
int K;
long long l, r;
int g[205], t[205], fac[205], ifac[205];
void init() {
  g[0] = 1;
  for (int i = 0; i < K; ++i) {
    t[0] = 0;
    for (int j = 0; j <= i; ++j)
      t[j] = (t[j] - (long long)(t[j + 1] = g[j]) * i) % P;
    memcpy(g, t, (i + 2) << 2);
  }
  for (int i = 0; i <= K; ++i)
    if (g[i] < 0) g[i] += P;
}
int owo(int n) {
  return ((mpower(phi1, n + 2) - mpower(phi2, n + 2)) / Num(0, 1)).a;
}
long long C(int n, int m) {
  return (long long)fac[n] * ifac[m] % P * ifac[n - m] % P;
}
int f(long long n) {
  Num s(0, 0);
  for (int i = 0; i <= K; ++i)
    for (int j = 0; j <= i; ++j) {
      Num t = mpower(phi1, j) * mpower(phi2, i - j);
      if (t.a == 1 && t.b == 0)
        s = s + Num(g[i], 0) * Num(C(i, j), 0) * Num(mpower(P - 1, i - j), 0) *
                    Num(n % P, 0) / mpower(Num(0, 1), i);
      else
        s = s + (t * t * t * (Num(1, 0) - mpower(t, n)) / (Num(1, 0) - t)) /
                    mpower(Num(0, 1), i) * Num(g[i], 0) * Num(C(i, j), 0) *
                    Num(mpower(P - 1, i - j), 0);
    }
  return s.a;
}
int main() {
  fac[0] = 1;
  for (int i = 1; i < 205; ++i) fac[i] = (long long)fac[i - 1] * i % P;
  ifac[204] = mpower(fac[204], P - 2);
  for (int i = 204; i; --i) ifac[i - 1] = (long long)ifac[i] * i % P;
  cin >> K >> l >> r;
  init();
  cout << (long long)(f(r) - f(l - 1) + P) * ifac[K] % P << endl;
  return 0;
}
