#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("omit-frame-pointer")
#pragma GCC optimize("unroll-loops")
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1000000;
using namespace std;
long long a[MAXN];
long long n, k, ans, r, l, i, b[MAXN], f;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    b[a[i]]++;
  }
  long long ans1, ans2;
  ans1 = 0;
  ans2 = 0;
  for (i = 1; i <= 100; i++) {
    if (b[i] && l == 0) {
      l = i;
      ans1 = b[i];
      f = 1;
      continue;
    }
    if (b[i] && l != 0 && f == 1) {
      r = i;
      ans2 = b[i];
      f = 2;
      continue;
    }
    if (b[i] && f == 2) {
      cout << "NO";
      return 0;
    }
  }
  if (ans1 == ans2 && l != r) {
    cout << "YES" << endl;
    cout << l << " " << r << endl;
    return 0;
  } else
    cout << "NO" << endl;
  return 0;
}
