Alex Goes Shopping

Here is my code below for the question no. 3 from contest 5191
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr = new int[N];
for(int i=0;i<arr.length;i++){
arr[i]=sc.nextInt();
}
Arrays.sort(arr);
int q = sc.nextInt();
while(q>0){
int A = sc.nextInt();
int k = sc.nextInt();
int count=0;
for(int i=0;i<arr.length-1;i++){
if(arr[i]==arr[i+1]) {
count++;
continue;
} else if(arr[i]<=A) {
count++;
//A-=arr[i];
}
}
if(count>=k){
System.out.println(“Yes”);
} else {
System.out.println(“No”);
}
q–;
}
}
}
can you please resolove this code. I’m getting a wrong answer for case 800 4 as input