using System.Collections.Generic; using System.Linq; 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]); var a = new int[n]; 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; var a = d.ToArray(); var aL = a.Length; for (int i = 0; i < aL - 1; i++) for (int j = i + 1; j < aL; j++) if ((a[i].Key ^ a[j].Key) == x) res += (long)a[i].Value * a[j].Value; return res; } 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; } }