#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
const int N = 233;
const int inv = 5e8 + 4;
int inv5;
class irrational {
 public:
  int a, b;
  irrational(int A = 0, int B = 0) : a(A), b(B) {}
  friend irrational operator+(irrational A, irrational B) {
    return irrational((A.a + B.a) % P, (A.b + B.b) % P);
  }
  friend irrational operator*(irrational A, irrational B) {
    return irrational((1ll * A.a * B.a + 5ll * A.b * B.b) % P,
                      (1ll * A.a * B.b + 1ll * B.a * A.b) % P);
  }
  friend irrational operator*(irrational &A, int B) {
    return irrational(1ll * A.a * B % P, 1ll * A.b * B % P);
  }
};
int k, ans;
long long l, r;
int c[N], tmp[N], com[N][N];
irrational M[3][3], G[3][3], Tmp[3][3];
inline void add(int &x, int y) { x = (x + y) % P; }
int Pow(int a, long long b) {
  if (b == 0) return 1;
  int ret = Pow(a, b >> 1);
  ret = 1ll * ret * ret % P;
  if (b & 1) ret = 1ll * ret * a % P;
  return ret;
}
irrational Pow(irrational a, long long b) {
  if (b == 0) return irrational(1, 0);
  irrational ret = Pow(a, b >> 1);
  ret = ret * ret;
  if (b & 1) ret = ret * a;
  return ret;
}
void Pow(long long n) {
  if (n == 0) {
    G[0][0] = G[1][1] = irrational(1, 0);
    G[0][1] = G[1][0] = irrational(0, 0);
    return;
  }
  Pow(n >> 1);
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      Tmp[i][j] = irrational(0, 0);
      for (int k = 0; k < 2; k++) Tmp[i][j] = (Tmp[i][j] + G[i][k] * G[k][j]);
    }
  memcpy(G, Tmp, sizeof(G));
  if (n & 1) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) {
        Tmp[i][j] = irrational(0, 0);
        for (int k = 0; k < 2; k++) Tmp[i][j] = (Tmp[i][j] + G[i][k] * M[k][j]);
      }
    memcpy(G, Tmp, sizeof(G));
  }
}
void work(long long r, int coefficient) {
  for (int m = 0; m <= k; m++) {
    irrational res(0, 0);
    for (int j = 0; j <= m; j++) {
      irrational q =
          Pow(irrational(inv, inv), j) * Pow(irrational(inv, -inv), m - j);
      M[0][0] = q, M[0][1] = irrational(0, 0), M[1][0] = q,
      M[1][1] = irrational(1, 0);
      Pow(r);
      res = res + ((m - j) & 1 ? -1 : 1) * com[m][j] * (G[1][0] + G[1][1]);
    }
    res = res * Pow(irrational(0, inv5), m);
    add(ans, 1ll * coefficient * c[m] * res.a % P);
  }
}
int main() {
  inv5 = Pow(5, P - 2);
  for (int i = 0; i < N; i++) {
    com[i][0] = 1;
    for (int j = 1; j <= i; j++)
      com[i][j] = (com[i - 1][j] + com[i - 1][j - 1]) % P;
  }
  cin >> k >> l >> r;
  c[0] = 1;
  for (int i = 0; i < k; i++) {
    tmp[0] = -1ll * i * c[0] % P;
    for (int j = 1; j < N; j++) tmp[j] = (c[j - 1] - 1ll * i * c[j]) % P;
    memcpy(c, tmp, sizeof(c));
  }
  work(r + 2, 1), work(l + 1, -1);
  for (int i = 2; i <= k; i++) ans = 1ll * ans * Pow(i, P - 2) % P;
  ans = (ans + P) % P;
  cout << ans << endl;
  return 0;
}
