#include <bits/stdc++.h>
using namespace std;
int K;
long long L, R;
int qpow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = (long long)ret * x % 1000000007;
    x = (long long)x * x % 1000000007;
    y >>= 1;
  }
  return ret;
}
struct node {
  int x, y;
  node() {}
  node(int x, int y) : x(x), y(y) {}
  friend node operator+(const node &r1, const node &r2) {
    return node((r1.x + r2.x) % 1000000007, (r1.y + r2.y) % 1000000007);
  }
  friend node operator-(const node &r1, const node &r2) {
    return node((r1.x - r2.x + 1000000007) % 1000000007,
                (r1.y - r2.y + 1000000007) % 1000000007);
  }
  friend node operator*(const node &r1, const node &r2) {
    return node(
        ((long long)r1.x * r2.x + (long long)r1.y * r2.y % 1000000007 * 5) %
            1000000007,
        ((long long)r1.x * r2.y + (long long)r1.y * r2.x) % 1000000007);
  }
  friend node operator*(int x, const node &r1) {
    return node((long long)r1.x * x % 1000000007,
                (long long)r1.y * x % 1000000007);
  }
  friend node operator/(const node &r1, const node &r2) {
    int t =
        (((long long)r2.x * r2.x - (long long)r2.y * r2.y % 1000000007 * 5) %
             1000000007 +
         1000000007) %
        1000000007;
    t = qpow(t, 1000000007 - 2);
    return r1 * node((long long)r2.x * t % 1000000007,
                     (long long)(1000000007 - r2.y) * t % 1000000007);
  }
} v1[210], v2[210], v3[210];
int a[210], C[210][210];
void init() {
  v1[0] = v2[0] = v3[0] = node(1, 0);
  v1[1] = node(1, 0) / node(0, 1);
  v2[1] = node(1, 1) / node(2, 0);
  v3[1] = node(1, 1000000007 - 1) / node(2, 0);
  for (int i = 2; i <= K; i++) {
    v1[i] = v1[i - 1] * v1[1];
    v2[i] = v2[i - 1] * v2[1];
    v3[i] = v3[i - 1] * v3[1];
  }
  for (int i = 0; i <= K; i++) C[i][0] = 1;
  for (int i = 1; i <= K; i++)
    for (int j = 1; j <= K; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
}
node qpow(node x, long long y) {
  node ret(1, 0);
  while (y) {
    if (y & 1) ret = ret * x;
    y >>= 1;
    x = x * x;
  }
  return ret;
}
node get(node x, long long n) {
  if (x.x == 1 && x.y == 0) return node(n % 1000000007, 0);
  return (qpow(x, n + 1) - x) / (x - node(1, 0));
}
int find(long long n, int m) {
  node ret(0, 0);
  for (int i = 0; i <= m; i++) {
    node t = get(v2[i] * v3[m - i], n);
    int v = (m - i) & 1 ? 1000000007 - C[m][i] : C[m][i];
    ret = ret + v * t;
  }
  ret = v1[m] * ret;
  return ret.x;
}
int calc(long long n) {
  int ret = 0;
  memset(a, 0, sizeof(a));
  a[0] = 1;
  for (int i = 0; i < K; i++) {
    for (int j = K; j >= 1; j--)
      a[j] = ((long long)a[j] * (1000000007 - i) % 1000000007 + a[j - 1]) %
             1000000007;
    a[0] = (long long)a[0] * (1000000007 - i) % 1000000007;
  }
  for (int i = 0; i <= K; i++) {
    int t = find(n, i);
    ret = (ret + (long long)a[i] * t) % 1000000007;
  }
  int t = 1;
  for (int i = 1; i <= K; i++) t = (long long)t * i % 1000000007;
  t = qpow(t, 1000000007 - 2);
  return (long long)t * ret % 1000000007;
}
int main() {
  scanf("%d%I64d%I64d", &K, &L, &R);
  init();
  printf("%d\n", (calc(R + 2) - calc(L + 1) + 1000000007) % 1000000007);
  return 0;
}
