#include <bits/stdc++.h>
using namespace std;
int n, vis[1001];
int tot, b[1001];
set<int> s;
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return x;
}
int main() {
  n = read();
  int a;
  for (register int i = 1; i <= n; i++) {
    a = read();
    if (!vis[a]) b[++tot] = a;
    vis[a]++;
    s.insert(a);
  }
  if (s.size() != 2) {
    cout << "NO" << endl;
    return 0;
  }
  if (vis[b[1]] == vis[b[2]]) {
    cout << "YES" << endl;
    cout << min(b[1], b[2]) << " " << max(b[1], b[2]) << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
