import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines MOD = 10**9 + 7 N, L, R = map(int, read().split()) dp = np.zeros(60, np.int64) dp[0] = 1 fct = 1 for n in range(N - 1): newdp = dp * n fct = fct * (n + 1) % MOD newdp[1:] += dp[:-1] dp = newdp % MOD answer = 0 for i in range(60): if L <= (1 << i) <= R: answer += dp[i] if L <= 0 <= R: answer += fct * (N - 1) answer %= MOD print(answer)