#![allow(unused_imports)] fn main() { input! { n: usize, q: usize, x: [usize; q], } println!("{}", x.into_iter().map(|x| { if x.is_multiple_of(n) || x.to_string().contains(&n.to_string()) { "Yes" } else { "No" } }).join("\n")); } use proconio::{input, marker::*}; use itertools::{iproduct, izip, Itertools as _}; use std::{cmp::Reverse, collections::*}; #[macro_export] macro_rules! chmax { ($a:expr, $b:expr) => {{ let tmp = $b; if $a < tmp { $a = tmp; true } else { false } }}; } #[macro_export] macro_rules! chmin { ($a:expr, $b:expr) => {{ let tmp = $b; if $a > tmp { $a = tmp; true } else { false } }}; } #[macro_export] /// mvec![] macro_rules! mvec { ($val:expr; ()) => { $val }; ($val:expr; ($size:expr $(,$rest:expr)*)) => { vec![mvec![$val; ($($rest),*)]; $size] }; }