#include #include #include using namespace __gnu_pbds; using namespace std; #define int int64_t template using ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; #define pi pair #define vi vector #define pb push_back #define all(x) (x).begin(), (x).end() template istream &operator>>(istream &in, vector &v) { for (auto &x : v) in >> x; return in; } template ostream &operator<<(ostream &out, const vector &v) { for (const auto &x : v) out << x << ' '; return out; } template istream &operator>>(istream &in, pair &p) { in >> p.first >> p.second; return in; } template ostream &operator<<(ostream &out, const pair &p) { out << p.first << ' ' << p.second; return out; } const int MOD = 1000000007; void solve() { vector v1 = {"gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red"}, v2 = {"gray", "green", "blue", "yellow", "red"}, v3 = {"gray", "green", "cyan", "blue", "violet", "orange", "red"}; string s1, s2, s3; cin >> s1 >> s2 >> s3; vector s = {s1, s2, s3}; sort(all(s)); int count = 0; do { if (find(all(v1), s[0]) != v1.end() && find(all(v2), s[1]) != v2.end() && find(all(v3), s[2]) != v3.end()) count++; } while (next_permutation(all(s))); cout << (count == 1 ? "Yes\n" : "No\n"); } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t = 1; while (t--) solve(); return 0; }