import java.io.*; import java.util.*; import java.math.*; import java.text.*; public class Main { public static void main(String[] args){ Scanner in=new Scanner(System.in); int x,n; while(in.hasNext()){ n=in.nextInt(); int[] a=new int[n]; for(int i=0;i<n;i++) a[i]=in.nextInt(); Arrays.sort(a); x=in.nextInt(); if(Arrays.binarySearch(a,x)>=0) System.out.println("YES"); else System.out.println("NO"); } } }
时间: 2024-11-09 11:04:11