#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long int ans = 0;
  int flag = 0;
  int a[101], b[n];
  for (int i = 0; i <= 100; i++) a[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    a[b[i]]++;
  }
  sort(b, b + n);
  if (b[0] == b[n / 2 - 1] && b[n / 2] == b[n - 1] &&
      b[n / 2] != b[n / 2 - 1]) {
    cout << "YES" << '\n';
    cout << b[0] << " " << b[n - 1] << '\n';
  } else
    cout << "NO" << '\n';
  return 0;
}
