#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a;
  map<int, int> A;
  for (int i = 0; i < n; i++) {
    cin >> a;
    A[a]++;
  }
  if (A.size() == 2 && A.begin()->second * 2 == n) {
    cout << "YES" << endl;
    auto it = A.begin();
    cout << it->first << " ";
    it++;
    cout << it->first;
  } else
    cout << "NO";
  return 0;
}
