#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string T; for (int i = 0; i < 3; i++) { string S; cin >> S; T += S; } bool ok = true; for (int i = 1; i < 9; i++) { ok &= T[i] != T[i - 1]; } cout << (ok? "Yes": "No") << endl; return 0; }