#include <bits/stdc++.h>
long long inv(int a, int p = 1000000007) {
  return a == 1 ? 1 : (1 + p * (a - inv(p % a, a))) / a % p;
}
struct num {
  int a, b;
  num(int a = 0, int b = 0) {
    this->a = a;
    this->b = b;
  }
  num operator+(num x) {
    return num((a + x.a) % 1000000007, (b + x.b) % 1000000007);
  }
  num operator-(num x) {
    return num((a - x.a + 1000000007) % 1000000007,
               (b - x.b + 1000000007) % 1000000007);
  }
  num operator*(num x) {
    return num((1ll * a * x.a + 5ll * b * x.b) % 1000000007,
               (1ll * a * x.b + 1ll * b * x.a) % 1000000007);
  }
};
num pow(num a, long long n, bool t = 0) {
  num p = 1, s = 0;
  int i = 0;
  while (n >> i) i++;
  while (i--) {
    s = s * (p + 1), p = p * p;
    if (n >> i & 1) s = s + p, p = p * a;
  }
  return t ? s : p;
}
long long a[210], C[210];
num pA[210], pB[210];
int main() {
  int k;
  long long l, r;
  std::cin >> k >> l >> r;
  *pA = *pB = *a = *C = 1;
  for (int i = 1; i <= k; (*a *= 1000000007 + 2 - ++i) %= 1000000007) {
    for (int j = i; j; j--)
      a[j] = (a[j - 1] + a[j] * (1000000007 - i + 1)) % 1000000007;
    pA[i] = pow(num(inv(2), inv(2)), i);
    pB[i] = pow(num(inv(2), 1000000007 - inv(2)), i);
  }
  num S = 0, c = *a, x;
  for (int i = 0; i <= k; i++, c = pow(num(0, inv(5)), i) * a[i]) {
    for (int j = i; j >= 0; j--) {
      x = (pow(pA[j] * pB[i - j], r + 3, 1) -
           pow(pA[j] * pB[i - j], l + 2, 1)) *
          (j ? (C[j] += C[j - 1]) %= 1000000007 : 1) * c;
      i - j& 1 ? S = S - x : S = S + x;
    }
  }
  for (int i = 1; i <= k; i++) S = S * inv(i);
  std::cout << S.a << '\n';
}
