#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 200 + 10;
const int mod = 1e9 + 7;
int qpow(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) c = 1ll * c * a % mod;
  return c;
}
int fac[N], C[N][N], S[N][N];
void init(int n) {
  for (int i = fac[0] = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  for (int i = C[0][0] = 1; i <= n; ++i)
    for (int j = C[i][0] = 1; j <= n; ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  for (int i = S[0][0] = 1; i <= n; ++i)
    for (int j = 1; j <= i; ++j)
      S[i][j] = (S[i - 1][j - 1] + 1ll * (i - 1) * S[i - 1][j]) % mod;
}
struct H {
  int x, y;
  H(int x_ = 0, int y_ = 0) : x(x_), y(y_) {}
  H conj() { return H(x, mod - y); }
};
H operator+(H a, H b) { return H((a.x + b.x) % mod, (a.y + b.y) % mod); }
H operator-(H a, H b) {
  return H((a.x - b.x + mod) % mod, (a.y - b.y + mod) % mod);
}
H operator*(H a, H b) {
  return H((1ll * a.x * b.x + 5ll * a.y * b.y) % mod,
           (1ll * a.x * b.y + 1ll * a.y * b.x) % mod);
}
H operator/(H a, H b) {
  return H((1ll * a.x * b.x + 1000000002ll * a.y % mod * b.y) % mod,
           (1ll * a.y * b.x + 1000000006ll * a.x % mod * b.y) % mod) *
         ::qpow((1ll * b.x * b.x + 1000000002ll * b.y % mod * b.y) % mod,
                mod - 2);
}
H qpow(H a, long long b) {
  H c(1, 0);
  for (; b; b >>= 1, a = a * a)
    if (b & 1) c = c * a;
  return c;
}
int calc(long long l, long long r, int k) {
  H A = H(0, 1) / 5, B = A.conj(), a = H(1, 1) / 2, b = a.conj(), res(0, 0);
  for (int i = 0; i <= k; ++i)
    for (int j = 0; j <= i; ++j) {
      H q = qpow(a, j) * qpow(b, i - j);
      if (q.x == 1 && !q.y)
        res = res + H((k - i) & 1 ? mod - 1 : 1) * S[k][i] * C[i][j] *
                        qpow(A, j) * qpow(B, i - j) * ((r - l + 1) % mod);
      else
        res = res + H((k - i) & 1 ? mod - 1 : 1) * S[k][i] * C[i][j] *
                        qpow(A, j) * qpow(B, i - j) *
                        (qpow(q, r + 1) - qpow(q, l)) / (q - 1);
    }
  return 1ll * res.x * qpow(fac[k], mod - 2) % mod;
}
int main() {
  int k = read();
  long long l = read(), r = read();
  init(k);
  printf("%d\n", calc(l + 2, r + 2, k));
  return 0;
}
