'use strict';
function main(input) {
  input = input.split("\n");
  const a = input[0];
  
  if (a[0] === a[1] && a[1] === a[2]) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));