#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 int n; int dp[1<<20]; int keep[1<<20][3]; int a[50]; void dfs(int x){ bitset<30> f(x); dp[x] = -1; rep(i,n){ if(f[i]==0)continue; srep(j,i+1,n){ if(f[j]==0)continue; srep(k,j+1,n){ if(f[k]==0)continue; if(a[i]==a[j]||a[j]==a[k]||a[k]==a[i])continue; if(a[i]a[j]&&a[j]>a[k])continue; int y = x - (1<> n; rep(i,n)cin >> a[i]; dfs((1<