#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;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    if (k == 1) {
        long long ans = (1LL * n * (1ll * n - 1)) / 2;
        long long len = 0;

        for (int i = 0; i < n; i++) {
            if (a[i] != 0) continue;

            len++;
            if (i + 1 == n - 1 || a[i + 1] != 0) {
                ans = ans - (len * (len + 1)) / 2;
                len = 0;
            }
        }

        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;
}
