#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b, long long int n) {
  long long int ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % n;
    a = (a * a) % n;
    b /= 2;
  }
  return ans;
}
signed main() {
  long long int n, p;
  set<long long int> s;
  vector<long long int> v;
  map<long long int, long long int> m;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> p;
    s.insert(p);
    if (m.find(p) == m.end()) {
      m[p] = 1;
      v.push_back(p);
    } else
      m[p]++;
  }
  if (s.size() != 2) {
    cout << "NO";
    return 0;
  }
  long long int a = v[0], b = v[1];
  if (m[a] != m[b]) {
    cout << "NO";
  } else {
    cout << "YES\n";
    cout << a << " " << b << endl;
  }
  return 0;
}
