#define skies dashabi
#include <bits/stdc++.h>
using namespace std;
const int N= 200+10;
#define inf 0x3f3f3f3f
#define ll long long
#define ull unsigned long long
#define PII pair<int,int>
inline int inc(int x,int v,int mod){x+=v;return x>=mod?x-mod:x;}
inline int dec(int x,int v,int mod){x-=v;return x<0?x+mod:x;}
inline int rd(){int x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
inline void write(int x){if(x==0){putchar(48);return;}int len=0,dg[20];while(x>0){dg[++len]=x%10;x/=10;}for(register int i=len;i>=1;i--)putchar(dg[i]+48);}
int a[N],n;
vector<int> b[N];
int dp[N];
bool fl;
void out(vector<int>va)
{
	cout<<va.size()<<" ";
	for(int i=0;i<va.size();i++)
	{
		printf("%d ",va[i]);
	}
	puts("");
}
void dfs(int x,vector<int>v,int sum)
{
	if(fl||x>n)return ;
	sum%=200;
	if(!b[sum].empty())
	{
		fl=1;
		puts("Yes");
		out(v);
		out(b[sum]);
		return ;
	}
	cout<<x<<" "<<sum<<endl;
	b[sum]=v;
	dfs(x+1,v,sum);
	v.push_back(x);
	dfs(x+1,v,sum+a[x]);
}
int g(int x)
{
	return ((x%200)+200)%200;
}
signed main()
{
	//freopen("未命名1.in","r",stdin);
	//freopen("未命名1.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		a[i]=rd();
		
	}
	for(int i=1;i<=n;i++)
	{
		a[i]%=200;
	}
	bool op=0;
	for(int i=1;i<=n;i++)
	{
		if(op)break;
		for(int j=0;j<=199;j++)
		{
			if(dp[g(j-a[i])]==1||j==a[i])
			{
				if(dp[j]==1)
				{
					puts("Yes");
					b[g(j-a[i])].push_back(i); 
					out(b[g(j-a[i])]);out(b[j]);
					op=1;
					break;
				}
				
			 } 
		}
		
		for(int j=199;j>=0;j--)
		{
			if(dp[g(j-a[i])]==1||j==a[i])
			{
				dp[j]=2;
				if(j!=a[i])
				b[j]=b[g(j-a[i])];
				b[j].push_back(i);
			}
		}
		for(int j=199;j>=0;j--)
		{
			if(dp[j]==2)dp[j]=1;
		}
	}
	if(!op)
	{
		puts("No");
	}
	
	
	
    return 0;
}

#line 1 "/workspaces/compro/lib/template.hpp"


#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>

#ifndef IO_VECTOR
#define IO_VECTOR

template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
  int size = v.size();
  for (int i = 0; i < size; i++) {
    std::cout << v[i];
    if (i != size - 1)
      std::cout << " ";
  }
  return out;
}

template <class T> std::istream &operator>>(std::istream &in, std::vector<T> &v) {
  for (auto &el : v) {
    std::cin >> el;
  }
  return in;
}

#endif
#line 4 "/workspaces/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 2 "main.cpp"

std::string solve(int N, const std::vector<std::string> &S) {
  map<string, bool> yes, no;
  REP(i, N) {
    if (S[i][0] == '!') {
      auto sub = S[i].substr(1, S[i].length() - 1);
      no[sub] = true;
    } else {
      yes[S[i]] = true;
    }
  }

  for (const auto el : yes) {
    auto [str, val] = el;
    if (no.find(str) != no.end()) {
      return str;
    }
  }
  for (const auto &el : no) {
    auto [str, val] = el;
    if (yes[str]) {
      cout << str << endl;
      return str;
    }
  }
  return "satisfiable";
}

// generated by online-judge-template-generator v4.7.1 (https://github.com/online-judge-tools/template-generator)
int main() {
  int N;
  std::cin >> N;
  std::vector<std::string> S(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> S[i];
  }
  auto ans = solve(N, S);
  std::cout << ans << std::endl;
  return 0;
}
