#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int b;
  cin >> n;
  map<int, int> c;
  map<int, int> a;
  for (int i = 0; i < n; i++) {
    cin >> b;
    a[b]++;
  }
  int j = 0;
  for (map<int, int>::iterator i = a.begin(); i != a.end(); i++) {
    j++;
    if (j > 2) {
      cout << "NO";
      return 0;
    }
  }
  if (j == 1) {
    cout << "NO";
    return 0;
  }
  map<int, int>::iterator h1 = a.begin();
  map<int, int>::iterator h2 = a.begin();
  h2++;
  if (h1->second == h2->second)
    cout << "YES\n";
  else {
    cout << "NO";
    return 0;
  }
  cout << h1->first << " ";
  cout << h2->first;
  return 0;
}
