#include<bits/stdc++.h>
using namespace std;
long long arr[1000000];
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);   
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    long long t,n,i,j,k,x,y,z;
    cin>>t;
    while (t--)
    {
    	cin>>n;
    	k=0;
    	x=0;
    	while (n>0)
    	{
    		if (n%11==0)
    		{
    			k=1;
    			break;
			}
			n-=100;
			x++;
			if (x>15)
			{
				break;
			}
		}
		if (k==1)
		{
			if (x>(n/11))
			{
				cout<<"NO"<<endl;
			}
			else
			{
				cout<<"YES"<<endl;
			}
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
}
