#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m;
int vis[maxn];
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (!vis[a]) cnt++;
    vis[a]++;
  }
  if (cnt != 2) {
    printf("NO\n");
  } else {
    int x1 = 0, x2 = 0;
    for (int i = 1; i <= 100; i++) {
      if (vis[i] && !x1)
        x1 = vis[i];
      else if (vis[i] && !x2)
        x2 = vis[i];
    }
    if (x1 != x2)
      printf("NO\n");
    else {
      printf("YES\n");
      for (int i = 1; i <= 100; i++)
        if (vis[i]) printf("%d ", i);
      puts("");
    }
  }
  puts("");
  return 0;
}
