#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 7;
const long double EPS = (long double)1e-5;
const int BASE = (int)1e9 + 7;
const int MAXN = 200500;
const long long INFLL = (long long)4e18;
int n;
int a[MAXN];
int b[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + 1 + n);
  int cnt = 0;
  int it = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1])
      cnt++;
    else {
      if (cnt != 0) b[++it] = cnt;
      cnt = 1;
    }
  }
  if (cnt) b[++it] = cnt;
  sort(b + 1, b + 1 + it);
  if (it == 2 && b[1] == b[2]) {
    cout << "YES\n";
    cout << a[1] << " " << a[n];
    return 0;
  }
  cout << "NO";
  return 0;
}
