包除原理を考えます
答えは
xxxxxxxxxx
n,x,y=map(int,input().split())
mod=10**9+7
ans=(pow(y-x+1,n,mod)-2*pow(y-x,n,mod)+pow(y-x-1,n,mod))%mod
print(ans)