#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int cnt[maxn];
vector<pair<int, int> > a;
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    int x;
    scanf("%d", &x);
    cnt[x]++;
  }
  for (int i = 1; i < 101; i++)
    if (cnt[i]) a.push_back(make_pair(cnt[i], i));
  sort(a.begin(), a.end());
  int sz = (int)a.size();
  if (sz != 2) {
    printf("NO\n");
    return 0;
  }
  for (int i = 0; i < sz - 1; i++)
    if (a[i].first == a[i + 1].first) {
      printf("YES\n%d\n%d\n", a[i].second, a[i + 1].second);
      return 0;
    }
  printf("NO\n");
  return 0;
}
