#include <bits/stdc++.h>
using namespace std;
int k, C[200 + 10][200 + 10], S[200 + 10][200 + 10], ans;
long long l, r;
void prepare() {
  int i, j;
  for (i = 0; i <= k; i++) {
    S[i][i] = 1;
    C[i][0] = 1;
    for (j = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
      S[i][j] = ((S[i - 1][j - 1] - 1ll * S[i - 1][j] * (i - 1)) % 1000000007 +
                 1000000007) %
                1000000007;
    }
  }
}
template <class T>
void Read(T &x) {
  char c;
  while (c = getchar(), c != EOF)
    if (c >= '0' && c <= '9') {
      x = c - '0';
      while (c = getchar(), c >= '0' && c <= '9') x = x * 10 + c - '0';
      ungetc(c, stdin);
      return;
    }
}
inline void read() { Read(k), Read(l), Read(r); }
int quick_pow(int a, int b) {
  int ret(1);
  while (b) {
    if (b & 1) ret = 1ll * ret * a % 1000000007;
    a = 1ll * a * a % 1000000007;
    b >>= 1;
  }
  return ret;
}
struct data {
  int a, b;
  inline data() {}
  inline data(int a, int b = 0) : a(a), b(b) {}
  inline data operator+(const data &x) const {
    return data((a + x.a) % 1000000007, (b + x.b) % 1000000007);
  }
  inline data &operator+=(const data &x) { return *this = *this + x; }
  inline data operator-(const data &x) const {
    return data((a - x.a + 1000000007) % 1000000007,
                (b - x.b + 1000000007) % 1000000007);
  }
  inline data &operator-=(const data &x) { return *this = *this - x; }
  inline data operator*(const data &x) const {
    return data((1ll * a * x.a + 5ll * b * x.b) % 1000000007,
                (1ll * a * x.b + 1ll * b * x.a) % 1000000007);
  }
  inline data &operator*=(const data &x) { return *this = *this * x; }
  inline data operator/(const data &x) const {
    static data ret;
    int inv;
    ret = *this * data(x.a, 1000000007 - x.b);
    inv = quick_pow(
        ((1ll * x.a * x.a - 5ll * x.b * x.b) % 1000000007 + 1000000007) %
            1000000007,
        1000000007 - 2);
    ret.a = 1ll * ret.a * inv % 1000000007;
    ret.b = 1ll * ret.b * inv % 1000000007;
    return ret;
  }
  inline data &operator/=(const data &x) { return *this = *this / x; }
};
data quick_pow(data a, long long b) {
  data ret(1);
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    b >>= 1;
  }
  return ret;
}
int cal(long long n, int m) {
  int i;
  data ret(0);
  data a((1000000007 + 1) >> 1, (1000000007 + 1) >> 1),
      b((1000000007 + 1) >> 1,
        1ll * (1000000007 - 1) * ((1000000007 + 1) >> 1) % 1000000007),
      gb, st;
  for (i = 0; i <= m; i++) {
    gb = quick_pow(a, i) * quick_pow(b, m - i);
    st = quick_pow(gb, 3);
    data t = (quick_pow(gb, n + 3) - st) / (gb - 1);
    if (gb.a == 1 && gb.b == 0) {
      t = n % 1000000007;
    }
    if ((m - i) & 1)
      ret -= t * C[m][i];
    else
      ret += t * C[m][i];
  }
  ret /= quick_pow(data(0, 1), m);
  return ret.a;
}
void solve() {
  int i, fac = 1;
  for (i = 1; i <= k; i++)
    ans = ((ans + 1ll * S[k][i] * (cal(r, i) - cal(l - 1, i))) % 1000000007 +
           1000000007) %
          1000000007;
  ans = (ans + (r - l + 1) % 1000000007 * S[k][0]) % 1000000007;
  for (i = 1; i <= k; i++) fac = 1ll * i * fac % 1000000007;
  ans = 1ll * ans * quick_pow(fac, 1000000007 - 2) % 1000000007;
}
int main() {
  read();
  prepare();
  solve();
  printf("%d\n", ans);
}
