#include <bits\stdc++.h>
using namespace std;
unordered_set<int> ss;
set<vector<int>> vv;
vector<int> v(5,0);
int sum()
{
int res = 0;
for (auto n : v)
{
res += n;
}
return res;
}
void show(vector<int> vf)
{
for (auto n : vf)
{
cout << n << " ";
}
cout << endl;
}
void dfs(int a, int b)
{
//cout << a << " " << b << endl;
if (b == 5)
{
if (a == 3)
{
vector<int> temp = v;
sort(temp.begin(), temp.end(), [](int &a,int &b) {
return a > b;
});
vv.insert(temp);
ss.insert(sum());
return;
}
dfs(a + 1, a + 2);
return;
}
else
{
v[a] += 3;
dfs(a, b + 1);
v[a] -= 3;
v[b] += 3;
dfs(a, b + 1);
v[b] -= 3;
v[a] += 1;
v[b] += 1;
dfs(a, b + 1);
v[a] -= 1;
v[b] -= 1;
}
}
int main(void)
{
dfs(0, 1);
/*
for (auto pp : vv) //输出所有排列可能
{
show(pp);
}
for (auto t : ss) //输出所有得分可能
{
cout << t << endl;
}
*/
int n;
cin >> n;
vector<int> ff(5);
for (int i = 0; i < 5; i++)
{
cin >> ff[i];
}
if (ss.count(n))
{
cout << "yes" << " ";
}
else
{
cout << "no" << " ";
}
if (vv.count(ff))
{
cout << "yes" << endl;
}
else
{
cout << "no" << endl;
}
return 0;
}
#算法题##科大讯飞#