#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  ios_base::sync_with_stdio(0);
  int n, x, kol = 0, mg = 0, t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[x]++;
  }
  for (int i = 0; i < 103; i++) {
    if (a[i] > 0) {
      kol++;
    }
  }
  if (kol == 2) {
    for (int i = 0; i < 103; i++) {
      if (a[i] > 0) {
        if (mg == 0) {
          mg = a[i];
          t = i;
        } else if (mg == a[i]) {
          cout << "YES" << endl;
          cout << t << ' ' << i;
        } else
          cout << "NO";
      }
    }
  } else {
    cout << "NO";
  }
  return 0;
}
