#include <bits/stdc++.h>
using namespace std;
void File() {
  freopen("output.txt", "w", stdout);
  freopen("input.txt", "r", stdin);
}
void fast() {
  ios::sync_with_stdio(NULL);
  cout.tie(NULL);
  cin.tie(NULL);
}
int main() {
  fast();
  int n;
  cin >> n;
  vector<int> arr(n);
  map<int, int> ans;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    ans[arr[i]]++;
  }
  if (((int)((ans).size())) != 2)
    cout << "NO\n";
  else {
    auto it = ans.begin(), it2 = ans.end();
    it2--;
    if (it->second == it2->second) {
      cout << "YES\n";
      cout << it->first << " " << it2->first << endl;
    } else
      cout << "NO\n";
  }
  return 0;
}
