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