#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def na4(n,m,l,j,d=0) Array.new(n){Array.new(m){Array.new(l){Array.new(j,d)}}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

l,r = inp
dp = na4(62,2,2,2)
dp[-1][0][0][0] = 1
(1..61).reverse_each do |i|
  (0..1).each do |j|
    (0..1).each do |k|
      (0..1).each do |s|
        t = [[0,0],[0,1],[1,1]]
        t.each do |nx,ny|
          nj,nk,ns = j,k,s
          next if(s == 0 and nx != ny)
          ns = 1 if(nx == 1)
          next if(r[i-1]< ny and k == 0)
          nk = 1 if(r[i-1]> ny)
          next if(nx<l[i-1] and j == 0)
          nj = 1 if(l[i-1]< nx)
          dp[i-1][nj][nk][ns] += dp[i][j][k][s]
        end
      end
    end
  end
end
p dp[0].flatten.inject(:+)%(10**9+7)