#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, freq[10001] = {};
  scanf("%d", &n);
  int c = 0;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    if (freq[x] == 0) {
      c++;
      v.push_back(x);
    }
    freq[x]++;
  }
  if (c != 2)
    return cout << "NO" << endl, 0;
  else if (freq[v[0]] == freq[v[1]] && v[0] != v[1]) {
    cout << "YES" << endl;
    cout << v[0] << " " << v[1] << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
