N, X = gets.split.map(&:to_i) A = N.times.map { gets.to_i } checked = Hash.new(false) C = A.tally C.default = 0 ans = 0 A.uniq.each do |a| next if checked[a] checked[a] = true y = X ^ a checked[y] = true cnt = C[y] next if cnt == 0 if a == y ans += cnt * (cnt - 1) else ans += cnt * C[a] end end puts ans