#include <bits/stdc++.h>
inline void ju() {
  freopen("***.in", "r", stdin);
  freopen("***.out", "w", stdout);
}
int b[500];
int cnt, s1, s2, x1, x2;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    if (!b[x]) ++cnt;
    ++b[x];
  }
  if (cnt != 2) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= 100; ++i)
    if (b[i]) {
      if (s1)
        s2 = b[i], x1 = i;
      else
        s1 = b[i], x2 = i;
    }
  if (s1 == s2)
    printf("YES\n%d %d\n", x1, x2);
  else
    puts("NO");
  return 0;
}
