program coincidence
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer(8) :: l, r, i, j, ans = 0_8
  read(*,*) l, r
  do i = l, r
    do j = i, min(2_8*i,r)
      if (i == and(i,j)) ans = mod(ans+1_8,md)
    end do
  end do
  write(*,'(i0)') ans
end program coincidence