#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  sort(a, a + n);
  int c = 0;
  for (int i = 0; i < n; i++)
    if (a[i] == a[0]) c++;
  if (c == n / 2 && s.size() == 2) {
    cout << "YES" << endl;
    cout << a[0] << " " << a[n - 1] << endl;
  } else {
    cout << "NO" << endl;
  }
}
