#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAX_N = 1000;
const int MAX_V = 0;
const int MAX_M = 0;
const int MAX_Q = 0;
void show(string a, int val) { cout << a << ":       " << val << endl; }
int N;
int a[MAX_N];
int b[MAX_N];
int main() {
  while (~scanf("%d", &N)) {
    for (int i = 0; i < N; i++) {
      cin >> a[i];
    }
    memset(b, 0, sizeof b);
    int mx = -1, mn = 10000;
    for (int i = 0; i < N; i++) {
      b[a[i]]++;
      mn = min(mn, a[i]);
      mx = max(mx, a[i]);
    }
    if (mn != mx && b[mn] == b[mx] && b[mn] == N / 2 && N % 2 == 0) {
      puts("YES");
      cout << mn << ' ' << mx << endl;
    } else {
      puts("NO");
    }
  }
}
