//1132
//substr(a,b) a 为起始位置,b 为个数
//用于截取字符串
#include <iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
freopen("1132.txt","r",stdin);
int n;
cin>>n;
for(int i = 0; i < n; i++){
string s;
cin>>s;
string s1, s2;
int len = s.length();
s1 = s.substr(0,len/ 2);
s2 = s.substr(len / 2, len / 2);
int a = stoi(s), b = stoi(s1), c = stoi(s2);
if((b*c)!=0 && a%(b*c)==0){//(b*c)!=0 ,不然会出现浮点错误
printf("Yes\n");
}else printf("No\n");
}
//cout << "Hello world!" << endl;
return 0;
}