#include using namespace std; typedef pair pii; typedef long long ll; const int N = 2000008, MOD = 998244353, INF = 0x3f3f3f3f; ll res; int n, m, cnt, w[N]; int main() { set st[4]; st[1] = {"gray","brown","green","cyan","blue","yellow","orange","red"},\ st[2] = {"gray","green","blue","yellow","red"}, \ st[3] = {"gray","green","cyan","blue","violet","orange","red"}; string s[4]; for (int i = 1; i < 4; i++) cin >> s[i]; sort(s + 1, s + 4); int c = 0; do { c += st[1].count(s[1]) && st[2].count(s[2]) && st[3].count(s[3]); } while (next_permutation(s + 1, s + 4)); puts(c == 1 ? "Yes" : "No"); return 0; }