#include <stdio.h>
int main(){
  int a,b,c,d,e,f;
  char ch,ch2;
  c =scanf("%d%d",&a,&b);
  d = scanf("%d%c%d",&e,&ch,&f);
 int count1,count2;
 for(int i =0;i<a;i++){
   e =e/10;
   count1 += 1;
 }
 for(int i =0;i<b;i++){
   f =f/10;
   count2 += 1;
 }

   if(d!=3) {
      printf("No");
    }
else{
  
  if(a ==count1 &&b ==count2){
    printf("Yes");
  }else{
    printf("No");
  }
}
   printf("%c,%d",ch2,aa);
  return 0;
}
