#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m;
int main() {
  long long int s;
  cin >> s;
  long long int b = s;
  while (s--) {
    long long int p;
    cin >> p;
    m[p]++;
  }
  long long int c = 0;
  vector<long long int> v;
  if (m.size() == 2) {
    for (auto it = m.begin(); it != m.end(); it++) {
      if (it->second == b / 2) c++;
      v.push_back(it->first);
    }
  }
  if (c == 2) {
    cout << "YES" << endl;
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
  } else
    cout << "NO";
}
