#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int inf = 1e15;
int n, m, k;
int w[200003];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  set<int> s;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    s.insert(a);
    w[a]++;
  }
  if (s.size() != 2) return cout << "NO", 0;
  int d1 = *s.begin();
  int d2 = *s.rbegin();
  if (w[d1] != w[d2]) return cout << "NO", 0;
  cout << "YES" << endl;
  cout << d1 << ' ' << d2 << endl;
  return 0;
}
