#include <bits/stdc++.h>
using namespace std;
int main() {
  int cardCount;
  cin >> cardCount;
  vector<int> cards = vector<int>(101, 0);
  int count = 0;
  for (int i = 0; i < cardCount; i++) {
    int card;
    cin >> card;
    if (cards[card] == 0) count++;
    cards[card]++;
  }
  if (count != 2)
    cout << "NO" << endl;
  else {
    int isSame = 0;
    int one, two;
    for (int i = 1; i <= 100; i++) {
      if (isSame == 0 && cards[i] != 0) {
        isSame = cards[i];
        one = i;
      } else if (cards[i] != 0 && isSame == cards[i]) {
        two = i;
      } else if ((cards[i] != 0 && isSame != cards[i])) {
        isSame = -1;
      }
    }
    if (isSame != -1)
      cout << "YES" << endl << one << " " << two << endl;
    else
      cout << "NO" << endl;
  }
}
