#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j = 0, k = 0, x, y, n, a[100];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  x = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] == x)
      continue;
    else {
      y = a[i];
      break;
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] == x)
      j++;
    else if (a[i] == y)
      k++;
  }
  if (j == k and (j + k == n)) {
    cout << "YES" << endl;
    cout << x << " " << y;
  } else
    cout << "NO" << endl;
}
