package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func next() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = nextInt()
	}
	return ints
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	nums := make(map[int]int)

	for i := 0; i < n; i++ {
		nums[nextInt()]++
	}

	// All 0
	if nums[0] == n {
		fmt.Println("Yes")
		return
	}

	// 0, x, x
	if len(nums) == 2 && n%3 == 0 && nums[0] == n/3 {
		fmt.Println("Yes")
		return
	}

	// x, y, z
	if len(nums) == 3 && n%3 == 0 {
		values := make([]int, 0)
		for _, value := range nums {
			values = append(values, value)
		}

		if values[0] == values[1] && values[1] == values[2] {
			fmt.Println("Yes")
			return
		}
	}

	fmt.Println("No")
}
