#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int a[1000];
  int b[1000];
  memset(b, 0, sizeof(b));
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (!b[a[i]]) {
      b[a[i]]++;
      ans++;
    } else
      b[a[i]]++;
  }
  if (ans != 2) {
    printf("NO\n");
  } else {
    int x, y;
    int flag = 1;
    for (int i = 0; i <= 100; i++) {
      if (flag && b[i]) {
        flag = 0;
        x = b[i];
        y = i;
      } else if (b[i]) {
        if (x == b[i]) {
          cout << "YES" << endl;
          printf("%d %d\n", y, i);
        } else
          cout << "NO" << endl;
        break;
      }
    }
  }
  return 0;
}
