#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#include<cctype>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<sstream>
#define mm(a,x) memset(a,x,sizeof(a))
#define maxn 100005
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
int main()
{
int k; cin>>k;
while(k--){
getchar();
string s;
cin>>s;
int sum=stoi(s);
int sum1=stoi(s.substr(0,s.length()/2));
int sum2=stoi(s.substr(s.length()/2));
if(!sum2)
{
cout<<"No\n";
continue;
}
if(sum%(sum1*sum2))
cout<<"No\n";
else cout<<"Yes\n";
}
}