// Arup Guha
// 5/2/2014
// Solution to 2014 UCF High School Contest Problem: Children of the Brood

import java.util.*;
import java.io.*;

public class brood {
	
	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("brood.in"));
		int numCases = fin.nextInt();
		
		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			// Create a frequency array for the size of each brood.
			int n = fin.nextInt();
			int[] freq = new int[n];
			for (int i=0; i<n; i++)
				freq[fin.nextInt()-1]++;
				
			// Output the solution.
			System.out.println("Class #"+loop+": "+solve(freq));
		}
		fin.close();
	}
	
	// Returns "YES" if and only if the class can fly in a viable arrangement.
	public static String solve(int[] freq) {
		
		int n = freq.length;
		
		// Find index of maximum value.
		int maxIndex = 0;
		for (int i=1; i<n; i++)
			if (freq[i] > freq[maxIndex])
				maxIndex = i;
				
		// Both sides same size case
		int max = 0;
		if (n%2 == 0) {
			// There are n/2 people on one side, at most half of those, rounded up, can
			// be on one team. Worst case is maximize both sides with the same team.
			max = 2*((n/2+1)/2);

		}
		else {
			// Annoying case - one side has n/2 students, the other side has (n+1)/2 students.
			max = (n/2+1)/2 + ((n+1)/2+1)/2;
		}
		
		// Final criteria for flying condition.
		if (freq[maxIndex] > max) return "NO";
		return "YES";
	}
}