#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++)
    {
        ull tmp = a[i];

        if (tmp >= K)
        {
            cnt += N - i;
        }
        else
        {
            for (int j = i + 1; j < N; j++)
            {
                tmp = tmp | a[j];

                if (tmp >= K)
                {
                    cnt += N - j;
                    break;
                }
            }
        }
    }

    cout << cnt;

    return 0;
}
