#include using namespace std; #define endl '\n' typedef long long ll; const int mod = 1e9 + 7; const int N = 1e5 + 10; const int LG = 64; ll n, l, r; ll dp[LG][N]; int main(int argc, char const *argv[]) { ios::sync_with_stdio(false); cin.tie(nullptr), cout.tie(nullptr); cin >> n >> l >> r; dp[0][n] = 1; for (int i = n - 1; i >= 1; i--) { for (int j = 0; j < LG; j++) { (dp[j][i] += dp[j][i + 1] * (n - 1 - i)) %= mod; if (j < LG - 1) (dp[j + 1][i] += dp[j][i + 1]) %= mod; } } ll c0 = n - 1; for (int i = 1; i <= n - 1; i++) (c0 *= i) %= mod; ll ans = (l ? 0 : c0); for (int i = 1; i < LG; i++) { if ((1ll << i) < l || r < (1ll << i)) continue; (ans += dp[i][1]) %= mod; } cout << ans << endl; return 0; }