#include #include #include #include #include using namespace std; int main() { int a[7]; int count = 0,p=1; cin >> a[0]; for (int i = 1; i < 7; i++) { cin >> a[i]; if (a[i - 1] == a[i])count++; if (count == 3) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }