#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, K;
    cin >> N >> K;
    unsigned int a[N];
    for (int i=0 ; i<N ; i++) cin >> a[i];

    int c, br=0;
    for (int l=0 ; l<N-1 ; l++)
    {
        c=a[l];
        for (int r=l+1 ; r<N ; r++)
        {
            c = c | a[r];
            if (c>=K) br++;
            //cout << "L=" << l << " R=" << r << " c=" << c << " br=" << br << endl;
        }
    }
    cout << br << endl;
    return 0;
}
