N, X = gets.split(" ").map{|s| s.to_i} a = Hash.new(0) N.times { a[gets.to_i] += 1 } cnt = 0 a.keys.each {|k| next if not a.has_key?(k) vk = a.delete(k) x = k ^ X if x == k then cnt += vk * (vk - 1) / 2 next end next if not a.has_key?(x) vx = a.delete(x) cnt += vk * vx } puts cnt