#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, d = 0, i, c = 0;
  cin >> n;
  long long int arr[n];
  for (i = 0; i < n; i++) {
    scanf("%lld\n", &arr[i]);
  }
  sort(arr, arr + n);
  for (i = 0; i < n; i++) {
    if (arr[i] == arr[0]) {
      c++;
    }
    if (arr[i] == arr[n - 1]) {
      d++;
    }
  }
  if (c * 2 == n && d * 2 == n) {
    printf("YES\n");
    printf("%lld %lld\n", arr[0], arr[n - 1]);
  } else {
    printf("NO\n");
  }
}
