#include <bits/stdc++.h>
using namespace std;
int a[102];
int b[102];
int main() {
  int n;
  cin >> n;
  int k = 0;
  for (int i = 1; i <= n; i++) {
    int q;
    scanf("%d", &q);
    if (!b[q]) {
      b[q]++;
      k++;
      a[k] = q;
    } else {
      b[q]++;
    }
  }
  if (k != 2)
    printf("NO\n");
  else {
    if (b[a[1]] == b[a[2]])
      printf("YES\n%d %d", a[1], a[2]);
    else
      printf("NO\n");
  }
  return 0;
}
