unittest
{
	assert( [ "1118" ].parse.expand.solve == "Yes" );
	assert( [ "7777" ].parse.expand.solve == "Yes" );
	assert( [ "1234" ].parse.expand.solve == "No" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto ns = input.front.strip.to!( dchar[] );
	return tuple( ns );
}

auto solve( dchar[] ns )
{
	auto gs = ns.group;
	
	if( 3 <= gs.front[ 1 ] ) return "Yes";
	gs.popFront;
	if( 3 <= gs.front[ 1 ] ) return "Yes";
	return "No";
}
