#include <iostream>
using namespace std;
int main() {
int prev = 0;
bool hasTwoEquals = false;
while(true){
int cur;
cin >> cur;
if (cur == 0){
break;
}
if (prev == cur){
hasTwoEquals = true;
prev = cur;
if (hasTwoEquals){
cout << "Yes" << endl;
else{
cout << "No" << endl;
return 0;
#include <iostream>
using namespace std;
int main() {
int prev = 0;
bool hasTwoEquals = false;
while(true){
int cur;
cin >> cur;
if (cur == 0){
break;
}
if (prev == cur){
hasTwoEquals = true;
break;
}
prev = cur;
}
if (hasTwoEquals){
cout << "Yes" << endl;
}
else{
cout << "No" << endl;
}
return 0;
}