#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int num;
    cin >> num;
    mp[num]++;
  }
  if (mp.size() != 2) {
    cout << "NO";
    exit(0);
  }
  if (mp.begin()->second != mp.rbegin()->second) {
    cout << "NO";
    exit(0);
  }
  cout << "YES\n";
  cout << mp.begin()->first << ' ' << mp.rbegin()->first;
  return 0;
}
