We call a 4-digit integer with three or more consecutive same digits, such as 1118, good.

You are given a 4-digit integer N. Answer the question: Is N good?

Constraints

* 1000 ≤ N ≤ 9999
* N is an integer.

Input

Input is given from Standard Input in the following format:


N


Output

If N is good, print `Yes`; otherwise, print `No`.

Examples

Input

1118


Output

Yes


Input

7777


Output

Yes


Input

1234


Output

No
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();
		
		if(N.charAt(0) == N.charAt(1)) {
			if(N.charAt(1) == N.charAt(2)) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} else {
			if(N.charAt(1) == N.charAt(2) && N.charAt(2) == N.charAt(3)) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}
}
