#include #include using namespace std; int main() { int n; cin >> n; long long a[114514]; for (int i = 0; i < n; i++)cin >> a[i]; sort(a, a + n); for (int i = 1; i < n - 1; i++)if (a[i] - a[i - 1] != a[i + 1] - a[i]) { cout << "NO\n"; return 0; } cout << "YES\n"; }