#include <iostream>
#define endl '\n'
using namespace std;
long long a[100005];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long n, k, br = 0, br0 = 0;
    cin >> n >> k;
    for ( int i = 0; i < n; i++ )
    {
        cin >> a[i];
        if ( a[i] == 0 ) br0++;
    }
    if ( k == 1 )
    {
        int tmp = 1, tmp0 = 1;
        for ( int i = n - 1; i >= 1; i-- )
        {
            tmp *= i;
        }
        for ( int i = br0 - 1; i >= 1; i-- )
        {
            tmp0 *= i;
        }
        cout << tmp - tmp0 - br0 << endl;
        return 0;
    }
    for ( int i = 0; i < n; i++ )
    {
        int tmp = a[i];
        if ( tmp >= k ) br++;
        for ( int j = i + 1; j < n; j++ )
        {
            tmp = tmp | a[j];
            if ( tmp >= k )
            {
                br += n - j;
                break;
            }
        }
    }
    cout << br << endl;
    return 0;
}
/**
for ( int i = n - 1; i >= 1; i-- )
    {
        for ( int j = 0; j < i; j++ )
        {
            if ( u[i] - u[j] >= k ) br++;
        }
    }
8 6
4 5 2 7 6 0 4 1

*/
