#include using namespace std; long long dp[100009][64], mod = 1000000007; int main() { dp[0][0] = 1; for (int i = 0; i < 100008; i++) { for (int j = 0; j < 63; j++) { dp[i + 1][j] += dp[i][j] * i; dp[i + 1][j] %= mod; dp[i + 1][j + 1] += dp[i][j]; dp[i + 1][j + 1] %= mod; } } long long N, L, R, sum = 0; cin >> N >> L >> R; for (int i = 0; i < 61; i++) { if (L <= (1LL << i) && (1LL << i) <= R) { sum += dp[N - 1][i]; sum %= mod; } } cout << sum << endl; return 0; }