//简单粗暴,要你变好,小心浮点错误
#include<iostream>
#include<string>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
string number;
cin>>number;
int len=number.size()/2;
int left=stoi(number.substr(0,len));
int right=stoi(number.substr(len));
int n=stoi(number);
if(left*right==0) cout<<"No"<<endl;
else if(n%(left*right)==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}