#include <bits/stdc++.h>
using namespace std;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  unordered_map<int, int> um;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    um[t]++;
  }
  pair<int, int> p[2];
  ;
  if (um.size() == 2) {
    int i = 0;
    for (auto tt : um) p[i++] = tt;
    if (p[0].second == p[1].second) {
      cout << "YES" << endl;
      cout << p[0].first << " " << p[1].first << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
