#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp;
  cin >> n;
  assert(n % 2 == 0);
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (m.find(temp) == m.end())
      m[temp] = 1;
    else
      m[temp]++;
  }
  if (m.size() != 2) {
    cout << "NO" << endl;
    return 0;
  }
  auto a = m.begin();
  auto b = m.begin();
  a++;
  if (a->second != b->second) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    cout << b->first << " " << a->first << endl;
  }
  return 0;
}
