#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int comb(const voida,const voidb)
{
return (int)a-(int)b;
}
int main(){
int n,m;
int a[1000]={0};
scanf("%d",&n);
scanf("%d",&m);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort(a,n,sizeof(int),comb);
/for(int i=0;i<n;i++){
printf("%d ",a[i]);
}/
int low=0,high=n-1,q=0,j=0,middle;
for(int k=0;;k++){
middle=(low+high)/2;
if(m>a[middle]){
low=middle+1;
j+=1;
}
else if(m<a[middle]){
high=middle-1;
j+=1;
}
else if(m==a[middle]){
q=1;
}
if(low>high){
break;
}
}
if(q==0){
printf("-1\n%d",j);
}
else if(q==1){
printf("%d\n%d",middle,j);
}
return 0;
}