#include using namespace std; int main(){ int n,q; cin>>n>>q; while (q--){ string x; cin>>x; bool ans=stoi(x)%n==0; int k=x.size(); for (int i=0;i