#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, i, j, k, l, m, n, p, q, r, s = 0, a, b, c, d, ans = 0, x, y;
  cin >> n;
  long long A[n + 10];
  map<long long, long long> mp;
  for (i = 0; i < n; i++) {
    cin >> A[i];
    mp[A[i]]++;
  }
  if (mp.size() != 2) {
    cout << "NO\n";
    return 0;
  }
  sort(A, A + n);
  if (mp[A[0]] != mp[A[n - 1]]) {
    cout << "NO\n";
    return 0;
  }
  if (A[0] == A[n - 1]) {
    cout << "NO\n";
    return 0;
  } else {
    cout << "YES\n";
    cout << A[0] << " " << A[n - 1] << endl;
  }
}
