#include <bits/stdc++.h>
using namespace std;
const long long N = 403, yyb = 1e9 + 7, inv2 = 500000004;
char buf[1000000], *p1, *p2;
inline char getChar() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long f = 0;
  register char c;
  while (!isdigit(c = getChar())) {
  }
  do f = f * 10 + (c ^ 48);
  while (isdigit(c = getChar()));
  return f;
}
inline long long power(long long x, long long y) {
  long long o = 1;
  for (; y; y >>= 1, x = x * x % yyb)
    if (y & 1) o = o * x % yyb;
  return o;
}
struct NewNum {
  long long a, b;
  NewNum() {}
  NewNum(long long a, long long b) : a(a), b(b) {}
  friend NewNum operator+(const NewNum& x, const NewNum& y) {
    return NewNum((x.a + y.a) % yyb, (x.b + y.b) % yyb);
  }
  friend NewNum operator+(const NewNum& x, const long long& y) {
    return NewNum((x.a + y) % yyb, x.b);
  }
  friend NewNum operator-(const NewNum& x, const NewNum& y) {
    return NewNum((x.a - y.a) % yyb, (x.b - y.b) % yyb);
  }
  friend NewNum operator-(const NewNum& x, const long long& y) {
    return NewNum((x.a - y) % yyb, x.b);
  }
  friend NewNum operator*(const NewNum& x, const NewNum& y) {
    return NewNum((x.a * y.a + 5 * x.b * y.b) % yyb,
                  (x.a * y.b + x.b * y.a) % yyb);
  }
  friend NewNum operator*(const NewNum& x, const long long& y) {
    return NewNum(x.a * y % yyb, x.b * y % yyb);
  }
  friend NewNum operator/(const NewNum& x, const NewNum& y) {
    return NewNum(x * NewNum(y.a, yyb - y.b) *
                  power((y.a * y.a - 5 * y.b * y.b) % yyb, yyb - 2));
  }
} inv[N];
inline NewNum power(NewNum x, long long y) {
  NewNum o = NewNum(1, 0);
  for (; y; y >>= 1, x = x * x)
    if (y & 1) o = o * x;
  return o;
}
long long k, facK, combine[N][N], stirling[N][N];
inline NewNum getPow(long long j, long long t) {
  return power(NewNum(inv2, inv2), t) * power(NewNum(inv2, yyb - inv2), j - t);
}
inline NewNum getSum(long long n, long long j, long long t) {
  NewNum x = getPow(j, t);
  if (x.a == 1 && x.b == 0) return NewNum(n, 0);
  return (power(x, n + 1) - x) / (x - 1);
}
inline long long calculate(long long n) {
  long long j, t;
  NewNum ans = NewNum(0, 0), o;
  for (j = 1; j <= k; ++j) {
    o = NewNum(0, 0);
    for (t = 0; t <= j; ++t)
      o = o + getSum(n, j, t) * ((j - t) & 1 ? -1 : 1) * combine[j][t];
    ans = ans + o * inv[j] * stirling[k][j] * facK * ((k + j) & 1 ? -1 : 1);
  }
  return ans.a;
}
signed main() {
  k = read();
  long long l = read(), r = read(), i, j;
  for (i = 0; i <= k; ++i) combine[i][0] = 1;
  for (i = 1; i <= k; ++i)
    for (j = 1; j <= i; ++j)
      combine[i][j] = (combine[i - 1][j - 1] + combine[i - 1][j]) % yyb;
  stirling[0][0] = stirling[1][1] = 1;
  for (i = 2; i <= k; ++i)
    for (j = 1; j <= i; ++j)
      stirling[i][j] =
          (stirling[i - 1][j] * (i - 1) + stirling[i - 1][j - 1]) % yyb;
  inv[0] = NewNum(1, 0), facK = 1;
  for (i = 1; i <= k; ++i)
    facK = facK * i % yyb, inv[i] = inv[i - 1] / NewNum(0, 1);
  facK = power(facK, yyb - 2);
  printf("%d\n", ((calculate(r + 2) - calculate(l + 1)) % yyb + yyb) % yyb);
  return 0;
}
