#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int distict_element = 0;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    if (mp.count(arr[i]) == 0) {
      mp[arr[i]]++;
      distict_element++;
    } else
      mp[arr[i]]++;
  }
  if (distict_element != 2) {
    cout << "NO";
  } else {
    auto it = mp.begin();
    int freq1 = mp[it->first];
    int el1 = it->first;
    it++;
    int freq2 = mp[it->first];
    int el2 = it->first;
    if (freq1 == freq2) {
      cout << "Yes" << endl;
      if (el1 > el2) {
        cout << el2 << " " << el1;
      } else {
        cout << el1 << " " << el2;
      }
    } else {
      cout << "No";
    }
  }
}
