n, x = read_line.split.map &.to_i a = n.times.map { read_line.to_i } cnt = Hash(Int32, Int64).new(0) a.each { |i| cnt[i] += 1 } ans = 0_i64 cnt.each do |val, c| val2 = val ^ x if val != val2 ans += c * cnt.fetch(val2, 0_i64) else ans += c * (c - 1) // 2 end end puts ans // 2