#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 1e18;
int a[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  set<int> st;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x]++;
    st.insert(x);
  }
  if (st.size() != 2)
    cout << "NO" << endl;
  else {
    int x = *st.begin();
    st.erase(st.begin());
    int y = *st.begin();
    if (a[x] != a[y])
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      cout << x << " " << y << endl;
    }
  }
}
