#include<bits/stdc++.h>
using namespace std;
vector<string> a;
string convert(int a) {
    string res;
    while(a>0) {
        int ost=a%2;
        res+=('0'+ost);
        a=a/2;
    }
    reverse(res.begin(), res.end());
    return res;
}

string biOperator(string a, string b) {
    string c;
    if(a.size()<b.size()) {
        reverse(a.begin(), a.end());
        for(int i=0;i<=b.size()-a.size();i++) {
            a+="0";
        }
        reverse(a.begin(), a.end());
    }
    if(b.size()<a.size()) {
        reverse(b.begin(),b.end());
        for(int i=0;i<=a.size()-b.size();i++) {
            b+="0";
        }
        reverse(b.begin(),b.end());
    }
    for(int i=0;i<a.size();i++) {
        if(a[i]=='1' || b[i]=='1') {
            c+="1";
        }else {
            c+="0";
        }
    }
    return c;
}
int comp(string a, string b) {
    reverse(a.begin(),a.end());
    while(a.back()=='0') a.pop_back();
    reverse(a.begin(),a.end());

    reverse(b.begin(),b.end());
    while(b.back()=='0') b.pop_back();
    reverse(b.begin(),b.end());
    if(a.size()<b.size()) return 2;
    if(a.size()>b.size()) return 1;
    if(a>=b) return 1;
    if(a<b) return 2;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,k_int;
    cin>>n>>k_int;
    string k=convert(k_int);
    for(int i=0;i<n;i++) {
        int z;
        cin>>z;
        a.push_back(convert(z));
    }
    int ans=0;
    for(int length=1;length<a.size();length++) {
        for(int start=0;start+length<=a.size();start++) {
            cout<<start<<" "<<start+length-1<<endl;
            string seg="0";
            for(int i=start;i<start+length;i++) {
                if(i==start) {
                    seg=a[i];
                }else {
                    seg=biOperator(seg,a[i]);
                }
            }
            if(comp(seg,k)==1) ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

