pub fn read<T: std::str::FromStr>() -> T {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).ok();
        s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
        read::<String>()
                .split_whitespace()
                .map(|e| e.parse().ok().unwrap())
                .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
        (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: u32) -> Vec<T> {
        (0..n).map(|_| read()).collect()
}

use std::collections::HashMap;

fn main() {
        let n: usize = read();
        let av: Vec<u32> = read_vec();
        let mut map: HashMap<u32, u32> = HashMap::new();
        let mut allzero: bool = true;

        for a in av {
                if a > 0 {
                        allzero = false;
                }
                let count = map.entry(a).or_insert(0);
                *count += 1;
        }
        if allzero {
                println!("Yes");
        } else if n % 3 != 0 {
                println!("No");
        } else if map.len() != 3 {
                println!("No");
        } else {
                let mut same: bool = true;
                let mut valiter = map.values();
                let val = valiter.next().expect("hoge");
                for tmp in valiter {
                        if tmp != val {
                                same = false;
                        }
                }
                if same {
                        println!("Yes");
                } else {
                        println!("No");
                }
        }
}
