function main(input) {
  input = input.split('\n');
  var a = input[0].split(' ')[0];
  var b = input[0].split(' ')[1];
  var s = input[1].split('-');
  var s1 = input[1].split('-')[0];
  var s2 = input[1].split('-')[1];
  if (s.length === 2 && s1.length == a) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));