#include <bits/stdc++.h>
#define endl '\n'

using namespace std;

constexpr int MAXN = 5050;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n, k, a[MAXN];
    cin >> n >> k;

    for (int i = 0; i < n; i++)
        cin >> a[i];

    int64_t ans = 0;
    for (int i = 0; i < n; i++)
    {
        int res = 0;
        for (int j = i; j < n; j++)
        {
            res = res|a[j];
            //cout << i+1 << " " << j+1 << " -> " << res << endl;
            if (res >= k)
            {
                //cout << i+1 << " " << j+1 << endl;
                ans += (n-j);
                break;
            }
        }
    }
    cout << ans << endl;

    return 0;
}
