using System.Collections.Generic; using System; public class Hello { static void Main() { var d = new Dictionary(); string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var x = int.Parse(line[1]); for (int i = 0; i < n; i++) { var w = int.Parse(Console.ReadLine().Trim()); if (d.ContainsKey(w)) d[w]++; else d[w] = 1; } Console.WriteLine(x == 0 ? case0(d) : caseNz(x, d)); } static long caseNz(int x, Dictionary d) { var res = 0L; foreach(var y in d) { var t = y.Key ^ x; if (d.ContainsKey(t)) res += (long)y.Value * d[t]; } return res / 2; } static long case0(Dictionary d) { var res = 0L; foreach (var x in d) if (x.Value >= 2) res += (long)x.Value * (x.Value - 1) / 2; return res; } }