#include using namespace std; #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") #define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w #define int long long //typedef long long ll; typedef vector vb; typedef vector vi; typedef vector vvb; typedef vector vvi; typedef pair P; template T &chmin(T &a, const T &b) { return a = min(a, b); } template T &chmax(T &a, const T &b) { return a = max(a, b); } const int INF=1e+18; const double EPS=1e-9; const int MOD=1000000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; signed main(){ int n,l,r,ans = 0,tmp = 1,dp[100010][70] = {},fact[100010] = {0,1}; cin >> n >> l >> r; for(int i = 2;i <= n;i++) fact[i] = (fact[i - 1] * i) % MOD; dp[0][0] = 1; for(int i = 1;i < n;i++){ for(int j = 1;j < 70;j++) dp[i][j] = (dp[i - 1][j - 1] + (i - 1) * dp[i - 1][j]) % MOD; } for(int i = 0;;i++){ if(tmp > r) break; if(l <= tmp && tmp <= r) ans = (ans + dp[n - 1][i]) % MOD; tmp *= 2; } if(!l) ans = (ans + fact[n] - fact[n - 1] + MOD) % MOD; cout << ans << endl; return 0; }