use std::io::{self, BufRead}; use std::collections::HashMap; fn main() { let stdin = io::stdin(); let mut lines = stdin.lock().lines(); // Nを読み込み let _n: usize = lines.next().unwrap().unwrap().parse().unwrap(); // 数列Aを読み込み let line = lines.next().unwrap().unwrap(); let a: Vec = line.split_whitespace() .map(|x| x.parse().unwrap()) .collect(); // 各数の出現回数をカウント let mut count_map = HashMap::new(); for &num in &a { *count_map.entry(num).or_insert(0) += 1; } // Qを読み込み let q: usize = lines.next().unwrap().unwrap().parse().unwrap(); // 結果を保存するベクター let mut results = Vec::new(); // 各クエリを処理 for _ in 0..q { let line = lines.next().unwrap().unwrap(); let parts: Vec<&str> = line.split_whitespace().collect(); let x: i64 = parts[0].parse().unwrap(); let k: usize = parts[1].parse().unwrap(); // 出現回数を取得 let count = count_map.get(&x).unwrap_or(&0); // 結果を保存 if *count >= k { results.push("Yes"); } else { results.push("No"); } } // 結果をまとめて出力 for result in results { println!("{}", result); } }