#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=1000100;
const int INF=1000000000;
int T;
int n;
vector<int> fib;
inline int read()
{
char c=getchar();
while(c!='-'&&!isdigit(c)) c=getchar();
int f=0,tag=1;
if(c=='-'){
tag=-1;
f=getchar()-'0';
}
else f=c-'0';
while(isdigit(c=getchar())) f=f*10+c-'0';
return f*tag;
}
void creat_fib()
{
fib.clear();
fib.push_back(0);
fib.push_back(1);
int x=fib[0]+fib[1];
while(x<=INF&&x>=0){
fib.push_back(x);
x=fib[fib.size()-1]+fib[fib.size()-2];
}
}
bool dfs(int n,int t)
{
if(t==2) return false;
while(true){
if(dfs(n,t-1)) return true;
if(n%fib[t]) break;
n/=fib[t];
}
if(n==1) return true;
return false;
}
int main()
{
cin>>T;
creat_fib();
while(T--){
n=read();
if(n==0||n==1||dfs(n,fib.size()-1)) printf("Yes\n");
else printf("No\n");
}
return 0;
}