There are some beautiful girls in Arpa’s land as mentioned before.

Once Arpa came up with an obvious problem:

Given an array and a number x, count the number of pairs of indices i, j (1 ≤ i < j ≤ n) such that <image>, where <image> is bitwise xor operation (see notes for explanation).

<image>

Immediately, Mehrdad discovered a terrible solution that nobody trusted. Now Arpa needs your help to implement the solution to that problem.

Input

First line contains two integers n and x (1 ≤ n ≤ 105, 0 ≤ x ≤ 105) — the number of elements in the array and the integer x.

Second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 105) — the elements of the array.

Output

Print a single integer: the answer to the problem.

Examples

Input

2 3
1 2


Output

1

Input

6 1
5 1 2 3 4 1


Output

2

Note

In the first sample there is only one pair of i = 1 and j = 2. <image> so the answer is 1.

In the second sample the only two pairs are i = 3, j = 4 (since <image>) and i = 1, j = 5 (since <image>).

A bitwise xor takes two bit integers of equal length and performs the logical xor operation on each pair of corresponding bits. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1. You can read more about bitwise xor operation here: <https://en.wikipedia.org/wiki/Bitwise_operation#XOR>.
/*package com.fancita.codeforces;*/

import java.io.*;
import java.util.Arrays;
import java.util.InputMismatchException;

/**
 * Created by ashutosh on 16/12/16.
 */
public class b383 extends FastIO {
    public static void main(String[] args) {
        int n = reader.readInt();
        int x = reader.readInt();
        int[] arr = IOUtils.readIntArray(reader, n);
        /*solveBF(arr, x);
        writer.printLine("now my solution");*/
        solve(arr, x);
        writer.flush();
        writer.close();
    }

    public static void solveBF(int[] arr, int x) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = i +  1; j < arr.length; j++) {
                if ((arr[i] ^ arr[j]) == x) {
                    writer.printLine("equal at " + arr[i] + ", " +  arr[j]);
                }
            }
        }
    }

    public static void solve(int[] arr, int x) {
        Arrays.sort(arr);
        /*writer.printLine(Arrays.toString(arr));*/
        if (x == 0) {
            writer.printLine(calculateDistinctNumbers(arr));
            return;
        }
        long ret = 0;
        for (int i = 0; i < arr.length; i++) {
            int leftIndex = binarySearchLeftIndex(arr, x ^ arr[i], 0, arr.length - 1);
            int rightIndex = binarySearchRightIndex(arr, x ^ arr[i], 0, arr.length - 1);
            ret += leftIndex >= 0 ? rightIndex - leftIndex + 1 : 0;
            /*boolean check = binarySearchContains(arr, x ^ arr[i], 0, arr.length - 1);
            if (check) writer.printLine("equal at " + arr[i] + ", " +  (x ^ arr[i]));
            ret += check ? 1 : 0;*/
        }
        writer.printLine(ret/2);
    }

    public static long calculateDistinctNumbers(int[] arr) {
        long ret = 0;
        int lastNo = arr[0];
        int lastRepeatCount = 1;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] != lastNo) {
                ret += efficientBinomialCoefficient(lastRepeatCount, 2);
                lastRepeatCount = 1;
                lastNo = arr[i];
                continue;
            }
            lastRepeatCount++;
        }
        return ret + (long) efficientBinomialCoefficient(lastRepeatCount, 2);
    }

    public static double efficientBinomialCoefficient(int x, int y) {
        if (y < 0 || y > x) return 0;
        if (y > x/2) {
            // choose(n,k) == choose(n,n-k),
            // so this could save a little effort
            y = x - y;
        }

        double denominator = 1.0, numerator = 1.0;
        for (int i = 1; i <= y; i++) {
            denominator *= i;
            numerator *= (x + 1 - i);
        }
        return numerator / denominator;
    }

    public static int binarySearchLeftIndex(int[] sortedArr, int numberToFind, int i, int j) {
        if (i > j) {
            return -1;
        }
        if (i == j) {
            return sortedArr[i] == numberToFind ? i : -1;
        }
        int mid = i + (j - i) / 2;
        if (sortedArr[mid] == numberToFind) {
            return binarySearchLeftIndex(sortedArr, numberToFind, i, mid);
        } else if (sortedArr[mid] < numberToFind) {
            return binarySearchLeftIndex(sortedArr, numberToFind, mid + 1, j);
        } else /*if (sortedArr[mid] > numberToFind)*/ {
            return binarySearchLeftIndex(sortedArr, numberToFind, i, mid - 1);
        }
    }

    public static int binarySearchRightIndex(int[] sortedArr, int numberToFind, int i, int j) {
        if (i > j) {
            return -1;
        }
        if (i == j) {
            return sortedArr[i] == numberToFind ? i : -1;
        }
        if (j - i == 1) {
            return sortedArr[j] == numberToFind ? j : sortedArr[i] == numberToFind ? i : -1;
        }
        int mid = i + (j - i) / 2;
        if (sortedArr[mid] == numberToFind) {
            return binarySearchRightIndex(sortedArr, numberToFind, mid, j);
        } else if (sortedArr[mid] < numberToFind) {
            return binarySearchRightIndex(sortedArr, numberToFind, mid + 1, j);
        } else /*if (sortedArr[mid] > numberToFind)*/ {
            return binarySearchRightIndex(sortedArr, numberToFind, i, mid - 1);
        }
    }

    public static boolean binarySearchContains(int[] sortedArr, int numberToFind, int i, int j) {
        if (i > j) {
            return false;
        }
        if (i == j) {
            return sortedArr[i] == numberToFind ? true : false;
        }
        int mid = i + (j - i) / 2;
        if (sortedArr[mid] == numberToFind) {
            return true;
        } else if (sortedArr[mid] < numberToFind) {
            return binarySearchContains(sortedArr, numberToFind, mid + 1, j);
        } else /*if (sortedArr[mid] > numberToFind)*/ {
            return binarySearchContains(sortedArr, numberToFind, i, mid - 1);
        }
    }
}

class FastIO {

    public static InputReader reader = new InputReader(System.in);
    public static OutputWriter writer	=	new OutputWriter(System.out);

    public static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    public static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void flush() {
            writer.flush();
        }

    }

    public static class IOUtils {

        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.readInt();
            return array;
        }

        /**
         * Read items into array starting from a given point
         * @param in
         * @param arr
         * @param i
         */
        public static void readIntArray(InputReader in, int[] arr, int i) {
            int n = arr.length;
            for (int j = i; j < n; j++) {
                arr[j] = in.readInt();
            }
        }
    }
}

