#include <bits/stdc++.h>
using namespace std;
const int N = 205, U = 5e8 + 4, V = 4e8 + 3;
int c[N][N], s[N][N], fac, k;
long long l, r, ans;
inline int ksm(long long x, register int L) {
  x = (x > 1000000007 ? x % 1000000007 : x);
  register int ans = 1;
  while (L)
    L& 1 ? ans = (0ll + ans) * x % 1000000007 : 0,
           x = (0ll + x) * x % 1000000007, L >>= 1;
  return ans;
}
struct ky {
  long long x, y;
  ky() {}
  ky(const long long a = 0, const long long b = 0) { x = a, y = b; }
  ky operator+(const ky& p) const {
    return ky((x + p.x) % 1000000007, (y + p.y) % 1000000007);
  }
  ky operator-(const ky& p) const {
    return ky((x - p.x + 1000000007) % 1000000007,
              (y - p.y + 1000000007) % 1000000007);
  }
  ky operator*(const ky& p) const {
    return ky((x * p.x + 5 * y * p.y) % 1000000007,
              (x * p.y + y * p.x) % 1000000007);
  }
  ky inv() const {
    ky A(x, 1000000007 - y);
    return A * ksm(((x * x - 5 * y * y) % 1000000007 + 1000000007) % 1000000007,
                   1000000007 - 2);
  }
  ky operator/(const ky& p) const { return *this * p.inv(); }
  bool operator==(const ky& p) const { return x == p.x && y == p.y; }
};
ky a = ky(0, V), b = ky(0, 1000000007 - V), x = ky(U, U),
   y = ky(U, 1000000007 - U);
template <class I>
inline ky ksm(register ky x, I L) {
  register ky ans = ky(1, 0);
  while (L) L& 1 ? ans = ans * x, 0 : 0, x = x * x, L >>= 1;
  return ans;
}
ky calc(register ky x) {
  if (x == 1) return (r - l + 1) % 1000000007;
  return (ksm(x, r + 1) - ksm(x, l)) / (x - 1);
}
int main() {
  scanf("%d%lld%lld", &k, &l, &r), s[1][1] = 1;
  register int i, j;
  l += 2, r += 2;
  for (i = 2; i <= k; ++i)
    for (j = 1; j <= i; ++j)
      s[i][j] = ((i - 1ll) * s[i - 1][j] + s[i - 1][j - 1]) % 1000000007;
  for (i = 0; i <= k; ++i) {
    c[i][0] = 1;
    for (j = 1; j <= i; ++j)
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1],
      c[i][j] = (c[i][j] >= 1000000007 ? c[i][j] - 1000000007 : c[i][j]);
  }
  fac = 1;
  for (i = 1; i <= k; ++i) fac = (0ll + fac) * i % 1000000007;
  for (i = 0; i <= k; ++i)
    for (j = 0; j <= i; ++j)
      ans = (ans +
             (0ll + ksm(1000000007 - 1, k - i)) * s[k][i] % 1000000007 *
                 c[i][j] % 1000000007 *
                 (ksm(a, j) * ksm(b, i - j) * calc(ksm(x, j) * ksm(y, i - j)))
                     .x) %
            1000000007;
  printf("%d",
         (0ll + ksm(fac, 1000000007 - 2)) * (ans + 1000000007) % 1000000007);
  return 0;
}
