Iahub and Iahubina went to a picnic in a forest full of trees. Less than 5 minutes passed before Iahub remembered of trees from programming. Moreover, he invented a new problem and Iahubina has to solve it, otherwise Iahub won't give her the food. 

Iahub asks Iahubina: can you build a rooted tree, such that

  * each internal node (a node with at least one son) has at least two sons; 
  * node i has ci nodes in its subtree? 



Iahubina has to guess the tree. Being a smart girl, she realized that it's possible no tree can follow Iahub's restrictions. In this way, Iahub will eat all the food. You need to help Iahubina: determine if there's at least one tree following Iahub's restrictions. The required tree must contain n nodes.

Input

The first line of the input contains integer n (1 ≤ n ≤ 24). Next line contains n positive integers: the i-th number represents ci (1 ≤ ci ≤ n).

Output

Output on the first line "YES" (without quotes) if there exist at least one tree following Iahub's restrictions, otherwise output "NO" (without quotes). 

Examples

Input

4
1 1 1 4


Output

YES

Input

5
1 1 5 2 1


Output

NO
import java.util.Arrays;
import java.util.Scanner;

/*
 * E - Guess the Tree.
 */

public class Main {
	/*
	 * Solve using backtracking w/ pruning.
	 * 
	 * Tree is int array, mapping node # to its parent. it is -1 if it's a leaf
	 * node it is -2 if unmapped. cap has the capacity of each node.
	 * 
	 * Pruning:
	 * 
	 * A root has the highest subtree size. A child's parent can't have a lower
	 * subtree size than its child.
	 * 
	 * the indices should be sorted in ascending order of size. index length-1
	 * should be the root.
	 */
	public static boolean treeBT(int[] numChildren, int[] remainingCap,
			int[] maxSize, int curr) {

		// Base case, only root left
		if (curr == -1) {
			// System.out.println(branches+" "+Integer.toBinaryString(parentBitset));
			int root = numChildren.length - 1;
			if (remainingCap[root] == 0) {
				// Make sure all internal nodes have at least 2 children (or 0
				// for leaves).

				for (int n = 0; n < numChildren.length; n++) {
					if (numChildren[n] < 2 && numChildren[n] != 0) {
						return false; // Invalid number of kids
					}
				}

				return true;
			} else {
				return false;
			}
		}

		if (remainingCap[curr] == 0 && numChildren[curr] < 2
				&& numChildren[curr] != 0) {
			return false;
		}

		if (maxSize[curr] != 1) {
			// internal nodes

			// Nothing below curr can be curr's parent, because it's max_size
			// will be smaller.
			for (int parent = curr + 1; parent < numChildren.length; parent++) {

				if (remainingCap[parent] == 0 && numChildren[parent] < 2
						&& numChildren[parent] != 0) {
					return false;
				}

				if (remainingCap[parent] - maxSize[curr] < 0) {
					// no room for child's subtree under parent
					continue;
				}

				// try it
				remainingCap[parent] -= maxSize[curr];
				numChildren[parent] += 1;

				if (treeBT(numChildren, remainingCap, maxSize, curr - 1)) {
					return true;
				}

				// reset
				remainingCap[parent] += maxSize[curr];
				numChildren[parent] -= 1;
			}
			// impossible tree, if no parent for this (nonroot) child.
			return false;
		} else {
			// leaf nodes, just stick them anywhere
			// if the tree exists, putting them anywhere is fine.
			int leaves = curr + 1; // number of leaf nodes.
			
			int[] newRemainingCap = remainingCap.clone();
			int[] newNumChildren = numChildren.clone();
			
			for (int i = curr + 1; i < newRemainingCap.length; i++) {
				int blanks = newRemainingCap[i];
				
				if (blanks > leaves) {
					return false;
				}
				
				leaves -= blanks;
				newNumChildren[i] += blanks;
				newRemainingCap[i] = 0;
			}
			
			if (leaves > 0) {
				return false;
			}
			
			// Now check to see if we're done
			if (treeBT(newNumChildren, newRemainingCap, maxSize, -1)) {
				return true;
			}
			else {
				return false;
			}
		}

		//return false;
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int total = sc.nextInt();

		int[] remainingCap = new int[total];
		int[] maxSize = new int[total];
		int[] numChildren = new int[total];
		Arrays.fill(numChildren, 0);

		// Read in
		for (int i = 0; i < total; i++) {
			maxSize[i] = sc.nextInt();
		}

		Arrays.sort(maxSize);

		//System.out.println(Arrays.toString(maxSize));

		for (int i = 0; i < total; i++) {
			remainingCap[i] = maxSize[i] - 1; // a node is part of its own
												// subtree
		}

		if (treeBT(numChildren, remainingCap, maxSize, total - 2)) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

		sc.close();
	}
}
