#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp;
  cin >> n;
  int arr[101];
  for (int i = 0; i < 101; i++) arr[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    arr[temp]++;
  }
  int var = 0;
  int c1 = 0, c2 = 0;
  int p1, p2;
  for (int i = 0; i < 101; i++) {
    if (arr[i] != 0) {
      if (c1 == 0) {
        c1 = arr[i];
        p1 = i;
      } else {
        c2 = arr[i];
        p2 = i;
      }
      var++;
    }
  }
  if (var != 2) {
    cout << "NO" << endl;
  } else {
    if (c1 == c2) {
      cout << "YES" << endl;
      cout << p1 << " " << p2 << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
