#include <bits/stdc++.h>
using namespace std;
int main() {
  int j, a[111], x, y, s = 0, m = 0, i = 2, n;
  cin >> n;
  for (j = 1; j <= n; j++) cin >> a[j];
  x = a[1];
  while (x == a[i]) {
    i++;
  }
  if (i > n) {
    cout << "NO";
    goto End;
  } else {
    y = a[i];
  }
  for (i = 1; i <= n; i++) {
    if (x == a[i])
      s++;
    else {
      if (y == a[i]) m++;
    }
  }
  if (s + m == n && s == m)
    cout << "YES\n" << x << " " << y;
  else {
    cout << "NO";
  }
End:
  return 0;
}
