#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t_1 = -1, t_2 = -1;
  int c1 = 0, c2 = 0;
  int a = 0;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    if (t_1 == -1) {
      t_1 = t;
      c1++;
    } else if (t_1 == t) {
      c1++;
    } else if (t_2 == -1) {
      t_2 = t;
      c2++;
    } else if (t_2 == t) {
      c2++;
    } else {
      a = -1;
    }
  }
  if (n % 2 == 1) a = -1;
  if (c1 != c2) a = -1;
  if (a == -1)
    cout << "NO" << endl;
  else
    cout << "YES\n" << t_1 << " " << t_2 << endl;
  return 0;
}
