#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int b, k, l;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  map<int, int>::iterator it = mp.begin(), it2 = mp.begin();
  if (mp.size() != 2)
    cout << "NO" << endl;
  else {
    it2++;
    if (it->second == it2->second)
      return cout << "YES" << endl << it->first << " " << it2->first << endl, 0;
    cout << "NO" << endl;
  }
  return 0;
}
