// inputに入力データ全体が入る
function Main(input) {
    var S = input;
    var count;
    for(var i = 0; i < 3; i++){
        var targetStr = S[i]
        count = (S.match(new RegExp(targetStr, "g" ))||[]).length;
    }
    if(count == 2){
        console.log("Yes")
    }else{
        console.log("No")
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));