package main import ( "fmt" "sort" "os" "bufio" "strconv" ) func main() { var n int fmt.Scan(&n) x := make([]int, n) sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) for i := 0; i < n; i++ { sc.Scan() x[i], _ = strconv.Atoi(sc.Text()) } sort.Ints(x) flag := true diff := x[1] - x[0] if (diff == 0) { flag = false } for i := 2; i < n && flag; i++ { if (x[i] - x[i-1] != diff) { flag = false } } if flag { fmt.Println("YES") } else { fmt.Println("NO") } }