#include<bits/stdc++.h>
using namespace std;
int a[100001];
int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    cin >> n >> k;
    int ans = 0;
    for(int i = 0; i < n; i++)cin >> a[i];
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            if(i == j)continue;
            if(a[i] | a[j] >= k)ans++;
            int l = a[i] | a[j];
            //cout << a[i] << " " << a[j] << " " << l << " " << k << endl;
        }
    }
    cout << ans;

    return 0;
}
