#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int l, r;
  cin >> l;
  cin >> r;
  int ans = 0;
  int mod = 1000000007;
  for (unsigned long long int i = l; i < r; i++) {
    for (unsigned long long int j = i + 1; j <= r; j++) {
      if ((j % i) == (j ^ i)) {
        ans = (ans + 1) % mod;
      }
    }
  }
  unsigned long long int temp = r - l + 1;
  ans = (ans + temp) % mod;
  cout << ans << endl;
  return 0;
}
