"use strict";

function main(arg) {
    const N = arg.split("\n")[0].split("");
    let previous;
    let cnt = 0;
    
    N.forEach(function(value) {
        if(value == previous) cnt++;
        previous = value;
    });
    
    console.log(cnt >= 2 ? "Yes" : "No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));