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