#include <bits/stdc++.h>
using namespace std;
int n, a[101], c, i, a1, b1, a2, b2;
bool f[101];
int main() {
  scanf("%d", &n);
  if (n % 2 == 1) {
    cout << "NO";
    return 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (f[a[i]] == 0) {
      c++;
    }
    f[a[i]] = 1;
    if (c >= 3) {
      cout << "NO";
      return 0;
    }
  }
  if (c != 2) {
    cout << "NO";
    return 0;
  }
  a1 = a[0];
  i = 0;
  while (a[i] == a1) {
    i++;
  }
  b1 = a[i];
  for (i = 0; i < n; i++) {
    if (a[i] == a1)
      a2++;
    else if (a[i] == b1)
      b2++;
  }
  if (a2 == b2) {
    cout << "YES\n" << a1 << " " << b1;
  } else
    cout << "NO";
}
