#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, a[10000], n;
  while (cin >> n) {
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int x = 0, y = 0;
    for (i = 0; i < n; i++) {
      if (a[i] == a[0]) x++;
      if (a[i] == a[n - 1]) y++;
    }
    if ((x == (n / 2)) && (y == (n / 2))) {
      cout << "YES" << endl;
      cout << a[0] << " " << a[n - 1] << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
