#include<algorithm> #include<cmath> #include<cstring> #include<iostream> #include<map> #include<queue> #include<stack> #include<vector> typedeflonglong ll; #define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) usingnamespace std;
intmain() { int n, a; cin >> n; for (int i = 0; i < n; i++) { cin >> a; int cot = a / 111; if (a % 11 <= cot) cout << "YES" << endl; else cout << "NO" << endl; } return0; }