"use strict";
    
const main = arg => {
    let N = arg.split("");
    let NewA = [];
    NewA.push(...N);
  	NewA.sort();
	let ans = "Yes";
  	for(let i = 0; i < 2; i++){
    	let x = N.shift();
      	if(N.indexOf(x) != -1){
      		N.splice(N.indexOf(x), 1);
        }
      	else {
        	ans = "No";
          	break;
        }
    }
	if(NewA[0] == NewA[2]){
    	   	ans = "No";
    }
  	console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
