#include #include void main(void) { int n = 0; scanf("%d",&n); int duckList[n]; for(int i = 0 ; i < n ; i++){ scanf("%d",&duckList[i]); } bool duckFlg = true; for(int i = 0 ; i < n ; i++){ for(int j = i ; j < n ; j++){ if(duckList[i] < duckList[j]){ int num = duckList[i]; duckList[i] = duckList[j]; duckList[j] = num; } } } int criteria = duckList[0] - duckList[1]; if(criteria == 0){ duckFlg = false; }else{ for(int i = 1 ; i < n-1 ; i++){ if(criteria != duckList[i] - duckList[i+1]){ duckFlg = false; } } } if(duckFlg){ printf("YES"); }else{ printf("NO"); } }