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