#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); set r1 = {"gray","brown","green","cyan","blue","yellow","orange","red"}; set r2 = {"gray","green","blue","yellow","red"}; set r3 = {"gray","green","cyan","blue","violet","orange","red"}; vector s(3); for (string &x : s) cin >> x; sort(s.begin(), s.end()); int ct = 0; do { if (r1.contains(s[0]) && r2.contains(s[1]) && r3.contains(s[2])) ct++; } while (next_permutation(s.begin(), s.end())); cout << (ct == 1 ? "Yes" : "No") << "\n"; return 0; }