#include <bits/stdc++.h>
using namespace std;
const int MAX = 5e6 + 5;
const long long mod = 1e9 + 7;
long long t, l, r, cnt;
long long f[MAX], p[MAX];
bool isprim[MAX];
long long pown(long long x, long long n) {
  if (n == 0) return 1;
  long long ans = 1;
  while (n) {
    if (n & 1) {
      ans = ans * x % mod;
    }
    x = x * x % mod;
    n >>= 1;
  }
  return ans;
}
void getprim(int n) {
  cnt = 0;
  for (int i = 0; i <= n; i++) {
    isprim[i] = true;
  }
  isprim[0] = isprim[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (isprim[i]) {
      p[cnt++] = i;
      for (int j = 2 * i; j <= n; j += i) isprim[j] = false;
    }
  }
}
void init() {
  for (long long i = 2; i <= r; i++) {
    if (isprim[i])
      f[i] = (i * (i - 1) / 2) % mod;
    else {
      for (long long j = 0; j < cnt; j++) {
        if (i % p[j] == 0) {
          f[i] = f[i / p[j]] + i / p[j] * f[p[j]];
          break;
        }
      }
    }
  }
}
void cal() {
  long long ans = 0;
  for (long long i = r; i >= l; i--) {
    ans = ans * t % mod;
    ans = (ans + f[i]) % mod;
  }
  cout << ans << endl;
}
int main() {
  cin >> t >> l >> r;
  getprim(r + 1);
  init();
  cal();
  return 0;
}
