#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  if (arr[0] == arr[n / 2 - 1] && arr[n / 2 - 1] != arr[n / 2] &&
      arr[n / 2] == arr[n - 1])
    cout << "YES\n" << arr[0] << " " << arr[n - 1];
  else {
    cout << "NO";
  }
  return 0;
}
