#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 5;
const int inf = 1e9 + 7;
map<int, int> q;
int main() {
  int n;
  scanf("%d", &n);
  int x;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    q[x]++;
  }
  if (q.size() == 2) {
    map<int, int>::iterator it1 = q.begin(), it2, it3;
    it3 = q.begin();
    it2 = ++it3;
    if (it1->second == it2->second) {
      puts("YES");
      printf("%d %d\n", it1->first, it2->first);
    } else
      puts("NO");
  } else
    puts("NO");
  return 0;
}
