#include <bits/stdc++.h>
using namespace std;
struct magic_nr {
  long long a, b;
  magic_nr() {}
  magic_nr(long long a, long long b) { this->a = a, this->b = b; }
};
long long K, l, r, comb[210][210], coef[210], aux[210];
magic_nr r1, r2, sr5;
long long fpow(long long nr, long long put) {
  long long res = 1;
  nr %= 1000000007;
  while (put) {
    if (put & 1) res = (res * nr) % 1000000007;
    nr = (nr * nr) % 1000000007;
    put >>= 1;
  }
  return res;
}
long long inv(long long nr) { return fpow(nr, 1000000007 - 2); }
magic_nr neg(magic_nr x) {
  x.a = -x.a, x.b = -x.b;
  return x;
}
magic_nr sum(magic_nr x, magic_nr y) {
  x.a = (x.a + y.a) % 1000000007;
  x.b = (x.b + y.b) % 1000000007;
  return x;
}
magic_nr prodc(long long c, magic_nr x) {
  c %= 1000000007;
  x.a = (c * x.a) % 1000000007;
  x.b = (c * x.b) % 1000000007;
  return x;
}
magic_nr prod(magic_nr x, magic_nr y) {
  magic_nr res;
  res.a =
      (x.a * y.a + (5 * (x.b * y.b) % 1000000007) % 1000000007) % 1000000007;
  res.b = (x.a * y.b + x.b * y.a) % 1000000007;
  return res;
}
magic_nr inv(magic_nr x) {
  magic_nr res;
  long long aux =
      (x.a * x.a - (5 * (x.b * x.b) % 1000000007) % 1000000007) % 1000000007;
  if (aux < 0) aux += 1000000007;
  res.a = x.a, res.b = (1000000007 - x.b) % 1000000007;
  aux = inv(aux);
  res = prodc(aux, res);
  return res;
}
magic_nr fpow(magic_nr x, long long put) {
  magic_nr res(1, 0);
  while (put) {
    if (put & 1) res = prod(res, x);
    x = prod(x, x);
    put >>= 1;
  }
  return res;
}
long long power_sum(long long r, long long put) {
  long long i;
  magic_nr f, s, produs, aux, res(0, 0);
  for (i = 0; i <= put; i++) {
    f = fpow(r1, i), s = fpow(r2, put - i);
    produs = prod(f, s);
    aux = produs;
    if ((produs.a - 1) % 1000000007 == 0 && produs.b == 0)
      produs = magic_nr((r + 1) % 1000000007, 0);
    else {
      produs = sum(fpow(produs, r + 1), magic_nr(-1, 0));
      produs = prod(produs, inv(sum(aux, magic_nr(-1, 0))));
    }
    if ((put - i) % 2)
      produs = prodc(-comb[put][i], produs);
    else
      produs = prodc(comb[put][i], produs);
    res = sum(res, produs);
  }
  res = prod(res, fpow(sr5, put));
  res = prodc(fpow(inv(5), put), res);
  if (res.b != 0) cout << "wtf\n";
  return res.a;
}
int main() {
  cin >> K >> l >> r;
  l += 2, r += 2;
  r1 = magic_nr(inv(2), inv(2));
  r2 = magic_nr(inv(2), 1000000007 - inv(2));
  sr5 = magic_nr(0, 1);
  long long i, j;
  comb[0][0] = 1;
  for (i = 1; i <= K; i++) {
    comb[i][0] = 1;
    for (j = 1; j <= i; j++)
      comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % 1000000007;
  }
  coef[0] = 1;
  for (i = 1; i <= K; i++) {
    for (j = 0; j <= i; j++) {
      aux[j] = -(i - 1) * coef[j];
      if (j > 0) aux[j] += coef[j - 1];
      aux[j] %= 1000000007;
      if (aux[j] < 0) aux[j] += 1000000007;
    }
    for (j = 0; j <= i; j++) coef[j] = aux[j];
  }
  long long res = 0;
  for (i = 1; i <= K; i++)
    res =
        (res + coef[i] * (power_sum(r, i) - power_sum(l - 1, i))) % 1000000007;
  res %= 1000000007;
  if (res < 0) res += 1000000007;
  for (i = 1; i <= K; i++) res = (res * inv(i)) % 1000000007;
  cout << res << "\n";
  return 0;
}
