#include <bits/stdc++.h>
using namespace std;
const double epsilon = 0.0000001;
const int mod = 1000000007;
double pi = 2 * acos(0.0);
vector<int> V[1];
vector<int> K[1];
bool flag[1];
int xe, y;
int gcd(int a, int b, int &x, int &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  int x1, y1;
  int d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
int gcd(long long a, long long b) { return a % b == 0 ? b : gcd(b % a, a); }
long long cnt;
void DFS(int U) {
  int i;
  if (flag[U]) return;
  flag[U] = true;
  for (i = 0; i < V[U].size(); i++) DFS(V[U][i]);
  cnt--;
}
long long soch(long long n, long long k) {
  int s = n % mod;
  for (int i = n - 1; i >= n - k + 1; i--) s = (s * i) % mod;
  for (int i = 2; i <= k; i++) {
    gcd(i, mod, xe, y);
    s *= (xe % mod + mod) % mod;
  }
  return s % mod;
}
list<pair<int, int> > A;
bool comp(const pair<int, int> &a, const pair<int, int> &b) {
  return a.first > b.first;
}
int main() {
  int n;
  int petya = -1, vasya = -1, a, cntv = 0, cntp = 0;
  cin >> n;
  cin >> petya;
  cntp++;
  for (int i = 1; i < n; i++) {
    cin >> a;
    if (petya != a) {
      if (vasya < 0) vasya = a;
      if (vasya == a)
        cntv++;
      else {
        cout << "NO";
        return 0;
      }
    } else
      cntp++;
  }
  if (cntv != cntp)
    cout << "NO";
  else {
    cout << "YES\n";
    cout << petya << " " << vasya;
  }
  return 0;
}
