def impossible?(n, k, x)
  until n == 0
    n -= 1
    k -= x
    break if k < 0
    x >>= 1
    break if x == 0
  end
  k < 0
end
n, k = gets.split.map(&:to_i)
p ((1..k).bsearch {|x| impossible?(n, k, x) } || k + 1) - 1
