#include <bits/stdc++.h>
using namespace std;
set<long long> s;
vector<long long> a;
long long cnt1, cnt2;
int main() {
  long long n, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    s.insert(x);
    a.push_back(x);
  }
  if (s.size() != 2)
    return cout << "NO", 0;
  else {
    long long firs = *s.begin();
    long long sec = *s.rbegin();
    for (int i = 0; i < n; i++)
      if (a[i] == firs)
        cnt1++;
      else if (a[i] == sec)
        cnt2++;
    if (cnt1 == cnt2)
      cout << "YES" << endl << firs << ' ' << sec;
    else
      cout << "NO";
  }
  return 0;
}
