#include <bits/stdc++.h>
using namespace std;
const int maxN = 205, mod = 1e9 + 7;
inline int ADD(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline int SUB(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }
inline int mpow(int a, long long x) {
  int ans = 1;
  while (x) {
    if (x & 1) ans = 1ll * ans * a % mod;
    a = 1ll * a * a % mod;
    x >>= 1;
  }
  return ans;
}
struct Num {
  int a, b;
  Num(int X = 0, int Y = 0) {
    a = X;
    b = Y;
  }
};
Num operator+(Num a, Num b) { return Num(ADD(a.a, b.a), ADD(a.b, b.b)); }
Num operator-(Num a, Num b) { return Num(SUB(a.a, b.a), SUB(a.b, b.b)); }
Num operator*(Num a, int p) {
  return Num(1ll * a.a * p % mod, 1ll * a.b * p % mod);
}
Num operator*(Num a, Num b) {
  return Num(ADD(1ll * a.a * b.a % mod, 5ll * a.b * b.b % mod),
             ADD(1ll * a.a * b.b % mod, 1ll * a.b * b.a % mod));
}
Num operator/(Num a, Num b) {
  return a * Num(b.a, mod - b.b) *
         mpow(SUB(1ll * b.a * b.a % mod, 5ll * b.b * b.b % mod), mod - 2);
}
int k, cnt;
int C[maxN + 1][maxN + 1];
int coef[maxN + 1];
long long L, R;
inline int binom(int n, int m) { return C[n][m]; }
inline Num Pow(Num a, long long x) {
  Num ans(1, 0);
  while (x) {
    if (x & 1) ans = ans * a;
    a = a * a;
    x >>= 1;
  }
  return ans;
}
inline int solve(long long n) {
  Num A, B, C, pw(1, 0);
  A.a = B.a = (mod + 1) / 2;
  A.b = (mod + 1) / 2, B.b = mod - (mod + 1) / 2;
  C.a = 0, C.b = mpow(5, mod - 2);
  int ans = 0;
  for (int i = 0; i <= k; i++) {
    Num s(0, 0);
    for (int j = 0; j <= i; j++) {
      Num cur = Pow(A, j) * Pow(B, i - j);
      Num t;
      if (cur.a == 1 && cur.b == 0)
        t = Num((n + 1) % mod, 0);
      else
        t = ((Num(1, 0) - Pow(cur, n + 1)) / (Num(1, 0) - cur));
      t = t * binom(i, j);
      if (i - j & 1)
        s = s - t;
      else
        s = s + t;
    }
    s = s * pw * coef[i];
    ans = ADD(ans, s.a);
    pw = pw * C;
  }
  return ans;
}
int main() {
  scanf("%d %lld %lld", &k, &L, &R);
  C[0][0] = 1;
  for (int i = 1; i <= k; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) C[i][j] = ADD(C[i - 1][j], C[i - 1][j - 1]);
  }
  coef[0] = 1;
  for (int i = 0; i < k; i++)
    for (int j = i; j >= 0; j--) {
      coef[j + 1] = ADD(coef[j + 1], coef[j]);
      coef[j] = 1ll * coef[j] * (mod - i) % mod;
    }
  int s = 1;
  for (int i = 1; i <= k; i++) s = 1ll * s * i % mod;
  s = mpow(s, mod - 2);
  for (int i = 0; i <= k; i++) coef[i] = 1ll * coef[i] * s % mod;
  printf("%d\n", SUB(solve(R + 2), solve(L + 1)));
  return 0;
}
