Discussion About Limited Budget Party

This is Discussion thread about Limited Budget Party

CORRECT FOR ALL INPUT STILL CANNOT PASS 2 TEST CASES HELP!!!

#include
using namespace std;
int main(){
int w,max;
cin>>w;
while(w>0){
int n;
cin>>n;
int target;
cin>>target;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}

 for(int i=0;i<n;i++){
     if(a[i]<=target){
         max=1;
     }
     if(a[i]>target){
         max=0;
         break;
     }
 }
 if(max==1){
     cout<<"YES"<<endl;
 }
 if(max==0){
     cout<<"NO"<<endl;
 }
 w--;
 }

 return 0;

}