package main

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

func main() {
	var n int
	fmt.Scan(&n)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	m := make(map[int]int)
	for i := 0; i < n; i++ {
		sc.Scan()
		x, _ := strconv.Atoi(sc.Text())
		m[x]++
	}

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

	if n%3 != 0 {
		fmt.Println("No")
		return
	}

	for _, v := range m {
		if v != n/3 {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}
