#include <bits/stdc++.h>
using namespace std;
string star[200000], str, str1;
long long ara[200005];
vector<pair<long long, long long> > ab;
vector<long long> x;
vector<long long> y;
map<long long, long long> dat;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, ans, temp, t, j, i, m, h, h2, m2, c, a, b, mx, d, k, l;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    if (!dat[a]) {
      x.push_back(a);
    }
    dat[a]++;
  }
  if (x.size() == 2) {
    if (dat[x[0]] == dat[x[1]]) {
      cout << "YES\n";
      cout << x[0] << " " << x[1];
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
