def base_set(nums) base = [] nums.each do |n| base.each do |b| if n ^ b < n n ^= b end end if n != 0 base << n end end base end N = gets.to_i A = gets.split.map(&:to_i) pp 2.pow(base_set(A).size)