#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); set a = { "gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red" }, b = { "gray", "green", "blue", "yellow", "red" }, c = { "gray", "green", "cyan", "blue", "violet", "orange", "red" }; string s, t, u; cin >> s >> t >> u; vector v = { s, t, u }; sort(v.begin(), v.end()); int cnt = 0; do { if (a.contains(v[0]) && b.contains(v[1]) && c.contains(v[2])) ++cnt; } while (next_permutation(v.begin(), v.end())); if (cnt == 1) { cout << "Yes" << '\n'; } else { cout << "No" << '\n'; } return 0; }