#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> cards;
  map<int, int> nums;
  int n, c, c1, c2;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &c);
    nums[c]++;
    cards.insert(c);
  }
  bool rta = false;
  set<int>::iterator it = cards.begin();
  c1 = *it;
  it++;
  c2 = *it;
  if (cards.size() == 2 && nums[c1] == nums[c2]) {
    rta = true;
  }
  if (rta) {
    printf("YES\n%d %d\n", c1, c2);
  } else {
    printf("NO\n");
  }
}
