#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(2e2 + 5);

int n;
int a[MAX_N];

int dp[MAX_N][200];

vector<vector<int>> candidates;

int get_valid_modulo() {
  if (dp[n][0] >= 3) return 0;

  for (int i = 1; i < 200; ++i) {
    if (dp[n][i] >= 2) return i;
  }

  return -1;
}

bool dfs(int cur, int modulo, vector<int> &hold) {
  if (cur == 0 && modulo == 0) {
    if (hold.empty()) return false;

    vector<int> tmp(hold);
    candidates.push_back(tmp);

    return candidates.size() >= 2;
  }

  if (cur == 0) return false;

  // do not use
  if (dp[cur - 1][modulo] != 0) {
    bool done = dfs(cur - 1, modulo, hold);
    if (done) return true;
  }

  // use
  hold.push_back(cur);
  int prev_modulo = (modulo - a[cur] + 200) % 200;
  if (dp[cur - 1][prev_modulo] != 0) {
    bool done = dfs(cur - 1, prev_modulo, hold);
    if (done) return true;
  }
  hold.pop_back();

  return false;
}

void retrieve(int modulo) {
  vector<int> hold;
  dfs(n, modulo, hold);
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    a[i] %= 200;
  }

  // initialize
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j < 200; ++j) {
      dp[i][j] = 0;
    }
  }
  dp[0][0] = 1;

  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < 200; ++j) {
      if (dp[i - 1][j] == 0) continue;

      int next_modulo = (j + a[i]) % 200;
      dp[i][next_modulo] += dp[i - 1][j];  // use a[i]
      dp[i][j] += dp[i - 1][j];            // do not use a[i]

      dp[i][next_modulo] = min(dp[i][next_modulo], 3);
      dp[i][j] = min(dp[i][j], 3);
    }
  }

  int modulo = get_valid_modulo();

  if (modulo < 0) {
    printf("No\n");
    return 0;
  }

  printf("Yes\n");

  retrieve(modulo);

  printf("%d ", candidates[0].size());
  sort(candidates[0].begin(), candidates[0].end());
  for (auto e : candidates[0]) {
    printf("%d ", e);
  }
  printf("\n");

  printf("%d ", candidates[1].size());
  sort(candidates[1].begin(), candidates[1].end());
  for (auto e : candidates[1]) {
    printf("%d ", e);
  }
  printf("\n");

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define inin(a, n, i) memset(a, i, sizeof(a[0])*(n))
#define contains(c, i) ((c).find(i) != (c).end())
#define present(i, c) (find(all(c), i) != (c).end())

#define trav(x, c) for(auto& x : c)
#define rep(i, n) for(int i = 0; i < n; i++)
#define repa(i, b, e) for(int i = (b)-((b)>(e)); i != (e)-((b)>(e)); i += 1-2*((b)>(e)))
	
template<class T> bool chkmax(T &x, T y) { return x < y ? x = y, true : false; }
template<class T> bool chkmin(T &x, T y) { return x > y ? x = y, true : false; }
template<class A, class B> A cvt(B x) { stringstream s; s << x; A r; s >> r; return r; }

void read() {}
void print() {}
template<class T, class... Args> void read(T& a, Args&... args) { cin >> a; read(args...); }
template<class T, class... Args> void print(T a, Args... args) { cout << a << ' '; print(args...); }
template<class... Args> void println(Args... args) { print(args...); cout << '\n'; }

#define debug(args...) { string s_(#args); replace(all(s_), ',', ' '); stringstream ss_(s_); istream_iterator<string> it_(ss_); cerr_(it_, args); }
void cerr_(istream_iterator<string> it) { (void) it; }
template<class T, class... Args> void cerr_(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; cerr_(++it, args...); }

template<class T, class S>  ostream& operator<<(ostream& os, const pair<T, S>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, const set<T> &s) { os << '{'; string sep; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<class T, class S> ostream& operator<<(ostream &os, const map<T, S> &m) { os << '{'; string sep; for (const auto &x : m) os << sep << x, sep = ", "; return os << '}'; }
template<class T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }

const int INF = 0x3F3F3F3F;
const int MAXN = (int) 1e6;
const int MOD = (int) 1e9+7;

//=========================

void run_test() {
    int n; read(n);
    vi a(n); rep(i, n) read(a[i]);

    int mx = *max_element(all(a));

    int nmx = 0, ans = 0;
    for(int x = 2; x <= mx; x++) {
        int c = 0;
        rep(i, n) if(a[i] % x == 0) c++;
        if(c > nmx) nmx = c, ans = x;
    }

    println(ans);
}

//=========================

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//int t_ = 1, t__; cin >> t__; while(t_ <= t__) { cout << "Case #" << t_++ << ": "; run_test(); }
	// int t_; cin >> t_; while(t_--) run_test();
	run_test();
	return 0;	
}
