public static void main(String[] args) throws IOException {
	//	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	BufferedReader br = new BufferedReader(new FileReader("input.in"));
		StringBuilder sb = new StringBuilder();
		String line = "";
		d: do {
			line = br.readLine();
			if (line == null)
				break;
			int n = Integer.parseInt(line);
			for (int i = 0; i < n; i++) {
				line = br.readLine();
				if (line.length() > 0)
					sb.append((check(line) ? "Yes" : "No")).append("\n");
				else
					sb.append("No\n");
			}
		} while (line != null);
		System.out.print(sb);
	}