import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

if len(A) % 3 == 0:
    c = Counter(A)
    k = c.keys()
    s = len(c.keys())
    ok = len(k) == 3 and len(Counter(c.values()).keys()) == 1
else:
    ok = False
if ok:
    print('Yes')
else:
    print('No')
