#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 1) + (x << 3) + ch - '0';
  return x * f;
}
const long long N = 205;
const long long P = 1e9 + 7;
long long C[N][N], S[N][N];
long long Pow(long long x, long long t) {
  long long res = 1;
  for (; t; t >>= 1, x = 1LL * x * x % P)
    if (t & 1) res = 1LL * res * x % P;
  return res;
}
long long inv(long long x) { return Pow(x, P - 2); }
namespace UnsafeMod {
long long add(long long a, long long b) {
  a += b;
  return a >= P ? a - P : a;
}
long long sub(long long a, long long b) {
  a -= b;
  return a < 0 ? a + P : a;
}
}  // namespace UnsafeMod
using namespace UnsafeMod;
namespace ComplexOperator {
struct Complex {
  long long x, y;
  Complex(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
};
Complex operator+(Complex a, Complex b) {
  return Complex((a.x + b.x) % P, (a.y + b.y) % P);
}
Complex operator-(Complex a, Complex b) {
  return Complex((a.x - b.x + P) % P, (a.y - b.y + P) % P);
}
Complex operator*(Complex a, Complex b) {
  return Complex((1LL * a.x * b.x % P + 1LL * a.y * b.y * 5 % P) % P,
                 (1LL * a.x * b.y % P + 1LL * a.y * b.x % P) % P);
}
Complex operator*(Complex a, long long b) {
  return Complex(1LL * a.x * b % P, 1LL * a.y * b % P);
}
Complex operator/(Complex a, Complex b) {
  a = a * Complex(b.x, P - b.y);
  b = b * Complex(b.x, P - b.y);
  return a * Pow(b.x, P - 2);
}
Complex Pow(Complex a, long long b) {
  Complex res = Complex(1, 0);
  for (; b; b >>= 1, a = a * a)
    if (b & 1) res = res * a;
  return res;
}
}  // namespace ComplexOperator
using namespace ComplexOperator;
long long k, invK = 1;
void init(long long n) {
  S[0][0] = 1;
  C[0][0] = 1;
  for (long long i = 1; i <= n; ++i) {
    C[i][0] = 1;
    for (long long j = 1; j <= i; ++j) {
      C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
      S[i][j] = add(S[i - 1][j - 1], 1LL * S[i - 1][j] * (i - 1) % P);
    }
  }
  for (long long i = 1; i <= k; ++i) invK = 1LL * invK * i % P;
  invK = inv(invK);
}
long long inv2 = inv(2);
Complex Sum(Complex a, long long n) {
  Complex temp = Complex(1, 0);
  if (a.x == 1 && a.y == 0)
    return Complex((n + 1) % P, 0);
  else
    return (Pow(a, n + 1) - temp) / (a - temp);
}
long long solve(long long n) {
  Complex a = Complex(1, 1) * inv2;
  Complex b = Complex(1, -1) * inv2;
  long long ans = 0;
  for (long long i = 0; i <= k; ++i) {
    long long temp = S[k][i];
    temp = (k - i) & 1 ? P - temp : temp;
    Complex sum = Complex();
    for (long long j = 0; j <= i; ++j) {
      Complex tmp = Complex();
      tmp.x = j & 1 ? P - C[i][j] : C[i][j];
      tmp = tmp * Sum(Pow(b, j) * Pow(a, i - j), n);
      sum = sum + tmp;
    }
    Complex inv = Complex();
    if (i & 1)
      inv.y = Pow(5, i / 2);
    else
      inv.x = Pow(5, i / 2);
    sum = sum / inv;
    ans = (ans + 1LL * temp * sum.x % P) % P;
  }
  return 1LL * ans * invK % P;
}
signed main() {
  k = read();
  long long l = read();
  long long r = read();
  init(N - 5);
  printf("%lld\n", (solve(r + 2) - solve(l + 1) + P) % P);
  return 0;
}
