#include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    /* code */
    string N;cin>>N;
    string res;
    if(N[0]==N[1]and N[0]==N[2])res="Yes";
    else
    {
        res="No";
    }
    cout<<res<<endl;
    return 0;
}
