import static java.math.BigInteger.ONE;
import static java.math.BigInteger.ZERO;
import static java.util.Arrays.deepToString;
import static java.util.Arrays.sort;

import java.io.*;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class mushrooms_nn_slow {

	static void solve() throws Exception {
		int n = nextInt();
		Query[] a = new Query[n];
		for (int i = 0; i < n; i++) {
			a[i] = new Query(new BigInteger(next()));
		}
		Query[] b = a.clone();
		sort(b);
		BigInteger f1 = ZERO;
		BigInteger f2 = ONE;
		int cur = 0;
		while (cur < n) {
			BigInteger f3 = f1.add(f2);
			while (cur < n && b[cur].n.compareTo(f3) < 0) {
				++cur;
			}
			while (cur < n && b[cur].n.equals(f3)) {
				b[cur].answer = true;
				++cur;
			}
			f1 = f2;
			f2 = f3;
		}
		for (Query e : a) {
			out.println(e.answer ? "Yes" : "No");
		}
	}

	static class Query implements Comparable<Query> {
		BigInteger n;
		boolean answer;

		public Query(BigInteger n) {
			this.n = n;
		}

		@Override
		public int compareTo(Query o) {
			return n.compareTo(o.n);
		}

	}

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	static void debug(Object... a) {
		System.err.println(deepToString(a));
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		try {
			File file = new File("mushrooms.in");
			InputStream input = System.in;
			OutputStream output = System.out;
			if (file.canRead()) {
				input = (new FileInputStream(file));
				output = (new PrintStream("mushrooms.out"));
			}
			br = new BufferedReader(new InputStreamReader(input));
			out = new PrintWriter(output);
			solve();
			out.close();
			br.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}