#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long Count = 1;
  long long Pos;
  sort(a, a + n);
  for (long long i = 0; i < n - 1; i++) {
    if (a[i + 1] > a[i]) {
      Count++;
      Pos = i + 1;
    }
  }
  if (Count != 2) {
    cout << "NO" << endl;
  } else {
    if (Pos == n / 2) {
      cout << "YES" << endl;
      cout << a[0] << " " << a[Pos] << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
