#include <bits/stdc++.h>
using namespace std;
const int base = 1e9 + 7;
const int maxn = 210;
struct num {
  int a, b;
  num() : a(0), b(0){};
  num(int _a, int _b) : a(_a), b(_b){};
  num(const num& T) : a(T.a), b(T.b){};
  num operator+(const num& T) {
    num res;
    res.a = (a + T.a) % base;
    res.b = (b + T.b) % base;
    return res;
  };
  num operator*(const num& T) {
    num res;
    res.a = (1ll * a * T.a + 5ll * b * T.b) % base;
    res.b = (1ll * a * T.b + 1ll * b * T.a) % base;
    return res;
  }
  num operator^(long long k) {
    if (!k) return num(1, 0);
    num res = num(a, b);
    num tmp = num(a, b);
    k--;
    while (k) {
      if (k & 1) res = res * tmp;
      tmp = tmp * tmp;
      k >>= 1;
    }
    return res;
  }
  friend num geometryseries(num T, long long k) {
    if (k == 0) return num(1, 0);
    if (k == 1) return T;
    vector<int> bits;
    while (k) {
      bits.push_back(k & 1);
      k >>= 1;
    }
    num res = T;
    num tmp = T;
    for (int i = bits.size() - 2; i >= 0; i--) {
      res = res + (res * tmp);
      tmp = tmp * tmp;
      if (bits[i]) {
        tmp = tmp * T;
        res = res + tmp;
      }
    }
    return res;
  }
};
int K;
long long l, r, inv[maxn], fact[maxn], C[maxn][maxn], S[maxn][maxn];
num fa[maxn];
num fb[maxn];
long long pw(long long a, long long k) {
  if (k == 0) return 1ll;
  if (k == 1) return a;
  long long tmp = pw(a, k / 2);
  tmp = (tmp * tmp) % base;
  if (k % 2 == 0) return tmp;
  return (tmp * a) % base;
}
long long rev(long long a) { return pw(a, base - 2); }
long long calc(long long n) {
  long long res = 0;
  for (int m = 0; m <= K; m++) {
    for (int j = 0; j <= m; j++) {
      num tmp = fa[j] * fb[m - j];
      tmp = geometryseries(tmp, n);
      if ((m - j) & 1) {
        tmp.a = (base - tmp.a) % base;
        tmp.b = (base - tmp.b) % base;
      }
      tmp = tmp * num(C[j][m], 0);
      if (m & 1)
        res = (res + S[m][K] * rev(pw(5, m >> 1)) % base * 1ll * tmp.b % base) %
              base;
      else
        res = (res + S[m][K] * rev(pw(5, m >> 1)) % base * 1ll * tmp.a % base) %
              base;
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fact[0] = 1, inv[0] = 1;
  for (int i = 1; i < maxn; i++) {
    fact[i] = (fact[i - 1] * i) % base;
    inv[i] = rev(fact[i]);
  }
  for (int i = 0; i < maxn; i++) C[0][i] = 1;
  for (int i = 1; i < maxn; i++)
    for (int j = 1; j < maxn; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i][j - 1]) % base;
  S[0][0] = 1;
  for (int i = 1; i < maxn; i++)
    for (int j = 1; j < maxn; j++)
      S[j][i] = (S[j - 1][i - 1] - (i - 1) * S[j][i - 1] % base + base) % base;
  num A0(rev(2), rev(2));
  num B0(rev(2), base - rev(2));
  for (int i = 0; i < maxn; i++) {
    fa[i] = A0 ^ i;
    fb[i] = B0 ^ i;
  }
  cin >> K >> l >> r;
  long long ans = calc(r + 2);
  ans = (ans - calc(l + 1) + base) % base;
  ans = (ans * inv[K]) % base;
  cout << ans;
}
