#![allow(non_snake_case)] #![allow(dead_code, unused_macros)] use std::process::exit; #[allow(unused_imports)] use proconio::{input, marker::Usize1, marker::Chars}; #[allow(unused_imports)] use itertools::Itertools; macro_rules! d { ( $( $x:expr ),* $(,)? ) => { println!( concat!( $( stringify!($x), "={:?} " ),* ), $( $x ),* ); }; } fn yn(b: bool) -> &'static str { if b { "Yes" } else { "No" } } fn main() { input! { N: i64, Q: i64, X: [i64; Q], } let f = |x: i64| { if x % N == 0 { return true; } let s = x.to_string(); if s.contains(&N.to_string()) { return true; } return false; }; for x in X { let b = f(x); println!("{}", yn(b)); } }