#include<stdio.h> #include<algorithm> using namespace std; int main() { int a[10010]; int n,k,i; scanf("%d%d",&n,&k); for(i=0;i<n;i++) { scanf("%d",&a[i]); } sort(a,a+n); int high,low,mid; high=n; low=0; while(high>=low) { mid=(high+low)/2; if(a[mid]>k) high=mid-1; if(a[mid]<k) low=mid+1; if(a[mid]==k) { printf("%d ",mid); return 0; } } printf("NO "); return 0; }