import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); HashMap map = new HashMap<>(); for (int i = 0; i < n; i++) { int y = sc.nextInt(); if (map.containsKey(y)) { map.put(y, map.get(y) + 1); } else { map.put(y, 1); } } long total = 0; if (x == 0) { for (int y : map.values()) { total += (long)(y - 1) * y / 2; } } else { for (Map.Entry entry : map.entrySet()) { int key = entry.getKey() ^ x; int value = entry.getValue(); if (map.containsKey(key)) { total += (long)value * map.get(key); } } total /= 2; } System.out.println(total); } }