#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592654;
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  int x;
  cin >> x;
  vector<int> v(x);
  for (long long(i) = 0; (i) < (long long)(x); (i)++) {
    cin >> v[i];
  }
  set<int> st((v).begin(), (v).end());
  if (st.size() % 2 != 0) {
    cout << "NO" << endl;
    return 0;
  }
  vector<int> vv(st.begin(), st.end());
  int c = 0;
  vector<int> s;
  for (int i = 0; i < vv.size(); i++) {
    c = 0;
    for (int j = 0; j < v.size(); j++) {
      if (vv[i] == v[j]) c++;
    }
    s.push_back(c);
  }
  if (s.size() != 2) {
    cout << "NO" << endl;
    return 0;
  }
  int a = 0;
  for (int i = 0; i < s.size() - 1; i += 2) {
    if (s[i] != s[i + 1]) {
      a = 1;
      break;
    }
  }
  if (a == 1)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (auto e : st) cout << e << " ";
  }
  cout << endl;
  return 0;
}
