#include <bits/stdc++.h>
using namespace std;
int n, i, x, z1, z, s1, s;
int main() {
  cin >> n;
  if (n % 2 == 1) {
    cout << "NO";
    return 0;
  }
  for (i = 1; i <= n; i++) {
    cin >> x;
    if (z1 == 0) {
      z1 = x;
      s1++;
    } else if (z == 0 && x != z1) {
      z = x;
      s++;
    } else if (x == z1)
      s1++;
    else if (x == z)
      s++;
  }
  if (s1 == s && s1 == n / 2)
    cout << "YES" << endl << z1 << " " << z;
  else
    cout << "NO";
  return 0;
}
