#include <bits/stdc++.h>
using namespace std;
namespace FI {
const int SIZE = 1 << 18 | 1;
char buf[SIZE], *front, *back;
void Char(char &c) {
  if (front == back) back = (front = buf) + fread(buf, 1, SIZE, stdin);
  c = (front == back) ? (char)EOF : *front++;
}
template <typename T>
void Num(T &x) {
  char c;
  int f = 1;
  for (Char(c); c > '9' || c < '0'; Char(c))
    if (c == '-') f = -1;
  for (x = 0; c >= '0' && c <= '9'; Char(c)) x = x * 10 + c - '0';
  x *= f;
}
}  // namespace FI
const int mod = 1e9 + 7;
const int inv2 = 5e8 + 4;
const int maxn = 200 + 47;
int add(int a, int b) { return (a + b) % mod; }
int sub(int a, int b) { return (a - b + mod) % mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int fpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
int inv(int a) { return fpow(a, mod - 2); }
long long k, l, r;
int frac[maxn], bakf[maxn];
int f[maxn];
struct num {
  int x, y;
  num(int x = 0, int y = 0) : x(x), y(y) {}
  num conj() { return num(x, sub(0, y)); }
  friend bool operator==(num a, num b) { return a.x == b.x && a.y == b.y; }
  friend num operator+(num a, num b) {
    return num(add(a.x, b.x), add(a.y, b.y));
  }
  friend num operator+(num a, int b) { return num(add(a.x, b), a.y); }
  friend num operator-(num a, num b) {
    return num(sub(a.x, b.x), sub(a.y, b.y));
  }
  friend num operator-(num a, int b) { return num(sub(a.x, b), a.y); }
  friend num operator*(num a, num b) {
    return num(add(mul(a.x, b.x), mul(5, mul(a.y, b.y))),
               add(mul(a.x, b.y), mul(a.y, b.x)));
  }
  friend num operator*(num a, int b) { return num(mul(a.x, b), mul(a.y, b)); }
  friend num operator/(num a, num b) {
    return a * b.conj() * inv(sub(mul(b.x, b.x), mul(5, mul(b.y, b.y))));
  }
  friend num operator/(num a, int b) {
    return num(mul(a.x, inv(b)), mul(a.y, inv(b)));
  }
} a[maxn], b[maxn];
int C(int a, int b) { return mul(mul(frac[a], bakf[b]), bakf[a - b]); }
num fpow(num a, long long b) {
  num res = num(1, 0);
  while (b) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  FI::Num(k), FI::Num(l), FI::Num(r);
  l++, r += 2;
  frac[0] = 1;
  for (int i = (1); i <= (k); i++) frac[i] = mul(frac[i - 1], i);
  bakf[k] = inv(frac[k]);
  for (int i = (k - 1); i >= (0); i--) bakf[i] = mul(bakf[i + 1], i + 1);
  f[0] = 1;
  for (int i = (0); i != (k); i++)
    for (int j = (i); j >= (0); j--) {
      f[j + 1] = add(f[j + 1], f[j]);
      f[j] = mul(f[j], sub(0, i));
    }
  num sqrt5 = num(0, 1), sq5k = num(1, 0), ans;
  a[0] = num(1, 0);
  for (int i = (1); i <= (k); i++) a[i] = a[i - 1] * num(inv2, inv2);
  b[0] = num(1, 0);
  for (int i = (1); i <= (k); i++) b[i] = b[i - 1] * num(inv2, sub(0, inv2));
  for (int i = (1); i <= (k); i++) {
    num sum;
    sq5k = sq5k * sqrt5;
    for (int j = (0); j <= (i); j++) {
      int k = (j & 1) ? sub(0, C(i, j)) : C(i, j);
      num q = a[i - j] * b[j];
      if (q == num(1, 0))
        sum = sum + mul((r - l) % mod, k);
      else
        sum = sum + (fpow(q, r + 1) - fpow(q, l + 1)) / (q - 1) * k;
    }
    ans = ans + sum * f[i] / sq5k;
  }
  int _ans = ans.x;
  _ans = mul(_ans, bakf[k]);
  printf("%d\n", _ans);
  return 0;
}
