#include <bits/stdc++.h>
using namespace std;
const int MXN = 1e6 + 7;
const double EPS = 1e-9;
const int INF = 1e9 + 7;
long long n, a[MXN], cnt, ans;
map<int, int> m;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] > a[i - 1]) {
      cnt++;
    }
    if (a[i] == a[1]) {
      ans++;
    }
  }
  if (cnt == 2 && n / 2 == ans) {
    cout << "YES" << '\n' << a[1] << ' ' << a[n];
    return 0;
  }
  cout << "NO";
  return 0;
}
