#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> counter;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    counter[a]++;
  }
  if (counter.size() == 2) {
    int num = counter.begin()->second;
    int first = -1;
    int second = -1;
    for (auto e : counter) {
      if (e.second != num) {
        printf("NO\n");
        return 0;
      }
      if (first == -1)
        first = e.first;
      else
        second = e.first;
    }
    printf("YES\n");
    printf("%d %d\n", first, second);
  } else
    printf("NO\n");
  return 0;
}
