#include <bits/stdc++.h>

#define MAXN 100005

using namespace std;

int n, k;
int a[MAXN];

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

    cin >> n >> k;

    int idx = 0;

    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] != 0) idx = max(idx, i);
    }

    if (k == 1) {
        long long ans = 0;

        for (int i = 0; i < n; i++) {
            if (a[i] != 0) ans += n - i;
            if (a[i] == 0 && i > idx) continue;
            if (a[i] == 0) ans += n - idx;
        }

        cout << ans << endl;

        return 0;
    }

    long long ans = 0;
    for (int i = 0; i < n; i++) {
        long long bitwise_or = 0;
        for (int j = i; j < n; j++) {
            bitwise_or = bitwise_or | a[j];
            if (bitwise_or >= k) ans++;
        }
    }

    cout << ans << endl;

    return 0;
}
