#include <bits/stdc++.h>
using namespace std;
void file() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const int N = 100005;
long long n, m, a[N], x[N], x1, x2;
bool b[N];
int main() {
  file();
  int l = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (b[a[i]] == 0 && m < 2) {
      b[a[i]]++;
      x[l] = a[i];
      ++l;
    }
  }
  if (l != 2) return cout << "NO", 0;
  for (int i = 0; i < n; ++i) {
    if (x[0] == a[i])
      ++x1;
    else
      ++x2;
  }
  if (x1 != x2)
    return cout << "NO", 0;
  else
    cout << "YES\n" << x[0] << " " << x[1];
}
