#include <bits/stdc++.h>
using std::abs;
using std::bitset;
using std::cerr;
using std::cin;
using std::copy;
using std::cout;
using std::deque;
using std::endl;
using std::fill;
using std::fixed;
using std::greater;
using std::iota;
using std::istream;
using std::lower_bound;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::multiset;
using std::next_permutation;
using std::nth_element;
using std::ostream;
using std::pair;
using std::priority_queue;
using std::queue;
using std::reverse;
using std::rotate;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::tie;
using std::tuple;
using std::unique;
using std::unordered_map;
using std::unordered_set;
using std::upper_bound;
using std::vector;
long long rnd(long long x, long long y) {
  static auto gen = std::bind(std::uniform_int_distribution<long long>(),
                              std::mt19937(960172));
  return gen() % (y - x + 1) + x;
}
long long gcd(long long a, long long b) {
  while (b > 0) {
    long long t = a % b;
    a = b;
    b = t;
  }
  return a;
}
template <typename T>
T sqr(T const& a) {
  return a * a;
}
int const INF = 100 + (int)1e9;
long long const INFL = 100 + (long long)1e18;
long double const PI = 3.1415926535897932384626433832795028;
int const mod = 1000000007;
void add(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int prod(int a, int b) { return (long long)a * b % mod; }
int modpow(int a, int b) {
  int ret = 1;
  for (; b > 0; b /= 2) {
    if (b % 2 == 1) {
      ret = prod(ret, a);
    }
    a = prod(a, a);
  }
  return ret;
}
int modinv(int a) { return modpow(a, mod - 2); }
struct irr {
  int a, b;
  irr() : a(0), b(0) {}
  irr(int x, int y) : a(x), b(y) {
    if (a >= mod) a -= mod;
    if (b >= mod) b -= mod;
  }
  irr& operator+=(irr const& x) {
    add(a, x.a);
    add(b, x.b);
    return *this;
  }
};
irr operator+(irr a, irr const& b) { return a += b; }
irr operator*(irr const& a, irr const& b) {
  return irr((prod(a.a, b.a) + 5LL * prod(a.b, b.b)) % mod,
             (prod(a.a, b.b) + prod(a.b, b.a)) % mod);
}
irr const one(1, 0);
irr const zero(0, 0);
irr const phi(modinv(2), modinv(2));
irr const psi(modinv(2), mod - modinv(2));
irr const alpha(0, modinv(5));
irr const beta(0, mod - modinv(5));
int const K = 222;
irr phis[K], psis[K], alphas[K], betas[K];
int c[K][K];
irr prog(irr a, long long n) {
  if (!n) return zero;
  if (n % 2) return one + a * prog(a, n - 1);
  return prog(a * a, n / 2) * (one + a);
}
int solve(long long n, int k) {
  irr ret(0, 0);
  for (int i = 0; i <= k; ++i) {
    for (int j = 0; j <= k; ++j) {
      irr now = irr(c[i][j], 0) * alphas[i] * betas[j];
      ret += now * prog(phis[i] * psis[j], n + 1);
    }
  }
  return ret.a;
}
void solve() {
  int k;
  long long l, r;
  scanf("%d%I64d%I64d", &k, &l, &r);
  phis[0] = psis[0] = alphas[0] = betas[0] = irr(1, 0);
  for (int i = 1; i <= k; ++i) {
    phis[i] = phis[i - 1] * phi;
    psis[i] = psis[i - 1] * psi;
    alphas[i] = alphas[i - 1] * alpha;
    betas[i] = betas[i - 1] * beta;
  }
  c[0][0] = 1;
  for (int x = 0; x < k; ++x) {
    static int t[K][K];
    for (int i = 0; i <= k; ++i) {
      for (int j = 0; j <= k; ++j) {
        add(t[i + 1][j], c[i][j]);
        add(t[i][j + 1], c[i][j]);
        add(t[i][j], prod(c[i][j], mod - x));
      }
    }
    for (int i = 0; i <= k; ++i) {
      copy(t[i], t[i] + k + 1, c[i]);
      fill(t[i], t[i] + k + 1, 0);
    }
  }
  int fact = 1;
  for (int i = 1; i <= k; ++i) {
    fact = prod(fact, i);
  }
  int inv_fact = modinv(fact);
  for (int i = 0; i <= k; ++i) {
    for (int j = 0; j <= k; ++j) {
      c[i][j] = prod(c[i][j], inv_fact);
    }
  }
  printf("%d\n", (solve(r + 2, k) - solve(l + 1, k) + mod) % mod);
}
int main() {
  cout.precision(15);
  cout << fixed;
  cerr.precision(6);
  cerr << fixed;
  solve();
}
