#include<bits/stdc++.h>

#define endl '\n'
#define D(x) cout << "|| " << "at " << __LINE__ << ", " << #x << " = " << (x) << endl

#define ull unsigned long long

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int N;
    ull K;
    vector<ull> a;

    cin >> N >> K;

    for (int i = 0; i < N; i++)
    {
        ull tmp;
        cin >> tmp;
        a.push_back(tmp);
    }

    ull cnt = 0;

    for (int i = 0; i < N; i++)
    {
        for (int j = i; j < N; j++)
        {
            ull tmp = a[i];
//
//            D(i);
//            D(j);

            for (int t = i + 1; t < j + 1; t++)
            {
//                D(t);
//                D(tmp);
                tmp = tmp | a[t];
            }
            if (tmp >= K)
            {
                cnt++;
//                cout << "||| cnt increased \n|";
//                D(tmp);
            }
        }
    }

    cout << cnt;

    return 0;
}
