#include <iostream>
using namespace std;
long long a[100005];
long long u[100005];
int main()
{
    long long n, k, br = 0;
    cin >> n >> k;
    for ( int i = 0; i < n; i++ )
    {
        cin >> a[i];
        if ( a[i] >= k ) br++;
    }
    u[0] = a[0] | 0;
    cout << u[0] << " ";
    for ( int i = 1; i < n; i++ )
    {
        u[i] = u[i-1] | a[i];
        ///cout << u[i] << " ";
    }
    for ( int i = 0; i < n; i++ )
    {
        int tmp = a[i];
        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

*/
