// Arup Guha
// 6/16/2014
// Solution to 2010 World Finals Problem J: Sharing Chocolate

import java.util.*;

public class j {

	// Stores previously solved true AND false cases.
	public static HashSet<Integer> memo;
	public static HashSet<Integer> badmemo;

	final public static int MAX = 101;
	public static int n;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		int loop = 1;

		// Go thorugh each case.
		while (n != 0) {

			// Read in parameters.
			int r = stdin.nextInt();
			int c = stdin.nextInt();
			int[] list = new int[n];
			for (int i=0; i<n; i++)
				list[i] = stdin.nextInt();

			// Set up memo tables.
			memo = new HashSet<Integer>();
			badmemo = new HashSet<Integer>();

			// Solve and output.
			System.out.println("Case "+loop+": "+solve(r, c, list));
			n = stdin.nextInt();
			loop++;
		}

	}

	// Returns the sum of the array a.
	public static int sum(int[] a) {
		int sum=0;
		for (int i=0; i<a.length; i++)
			sum += a[i];
		return sum;
	}

	// Returns the sum of the items in list specified by mask.
	public static int getSum(int mask, int[] list) {
		int i=0, sum = 0;
		while (mask > 0) {
			if ((mask & 1) == 1)
				sum += list[i];
			i++;
			mask = mask >> 1;
		}
		return sum;
	}

	public static String solve(int r, int c, int[] list) {

		// To avoid array out of bounds.
		if (sum(list) != r*c) return "No";

		// Store sums of all subsets.
		int n = list.length;
		int[] subsum = new int[1<<n];
		for (int i=0; i<(1 << n); i++)
			subsum[i] = getSum(i, list);

		// Create a reverse lookUp
		HashSet[] lookUp = new HashSet[r*c+1];
		for (int i=0; i<lookUp.length; i++)
			lookUp[i] = new HashSet<Integer>();

		for (int i=0; i<subsum.length; i++)
			lookUp[subsum[i]].add(i);

		// Make initial recursive call and answer.
		if (go(r, c, (1 << n)-1, list, lookUp))
			return "Yes";
		return "No";
	}

	// Solves problem for dimensions r x c for the subset mask.
	public static boolean go(int r, int c, int mask, int[] list, HashSet[] lookUp) {

		// All we really need to store is one dimension here in our mask.
		// The other is determined by the area specified by mask.
		int totalMask = (r << n) + mask;

		// We did this before.
		if (memo.contains(totalMask)) return true;
		if (badmemo.contains(totalMask)) return false;

		// One piece case.
		if (Integer.bitCount(mask) == 1)
			return r*c == getSum(mask, list);

		// Try solving with a row split.
		for (int split=1; split<=r/2; split++) {
			for (Integer x: (HashSet<Integer>)lookUp[split*c]) {

				// Subsets didn't line up.
				if ((mask & x) != x || !lookUp[(r-split)*c].contains(mask-x)) continue;

				// Try both sides.
				boolean top = go(split, c, x, list, lookUp);
				boolean ans = false;
				if (top) ans = go(r-split, c, mask-x, list, lookUp);
				if (ans) {
					memo.add(totalMask);
					return true;
				}
			}
		}

		// Try solving with a col split.
		for (int split=1; split<=c/2; split++) {
			for (Integer x: (HashSet<Integer>)lookUp[split*r]) {

				// Subsets didn't line up.
				if ((mask & x) != x || !lookUp[(c-split)*r].contains(mask-x)) continue;

				// Try both sides.
				boolean top = go(r, split, x, list, lookUp);
				boolean ans = false;
				if (top) ans = go(r, c-split, mask-x, list, lookUp);
				if (ans) {
					memo.add(totalMask);
					return true;
				}
			}
		}

		// Store these!
		badmemo.add(totalMask);
		return false;
	}
}