@@ -0,0 +1,30 @@
+#include <iostream>
+
+using namespace std;
+using ll=long long;
+int main() {
+ int a[10] = {1};
+ for (int i = 1; i <= 9; i++) {
+ a[i] = i * a[i - 1];
+ }
+ int t;
+ cin >> t;
+ while (t--) {
+ int x;
+ cin >> x;
+ for (int i = 9; i >= 1; i--) {
+ if (x >= a[i]) {
+ x -= a[i];
+ if (x == 0) {
+ cout << "Yes" << endl;
+ } else {
+ cout << "No" << endl;
+ return 0;
+}