import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    auto n = sread();
    // writeln(n);
    if ((n[0] == n[1]) && (n[0] == n[2]))
    {
        writeln("Yes");
        return;
    }
    if ((n[1] == n[2]) && (n[1] == n[3]))
    {
        writeln("Yes");
        return;
    }
    writeln("No");

}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
