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