'use strict'
const Main = (arg) => {
  let S = arg.trim().split('\n');
  console.log({ S });
  Ans = 'No';
  if (S[0] === S[1] && S[2] === S[3] && S[0] !== S[2]) {
    Ans = 'Yes'
  } else if (S[0] === S[2] && S[1] === S[3] && S[0] !== S[1]) {
    Ans = 'Yes'
  } else if (S[0] === S[3] && S[1] === S[2] && S[0] !== S[1]) {
    Ans = 'Yes'
  }
  
  
  console.log(Ans)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
