#include <bits/stdc++.h>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  char s[15];
  scanf("%s", s);
  int i = 0;
  while (s[i] != '-' && s[i] != '\0') {
    i++;
    a--;
  }
  while (s[i + 1] != '\0') {
    i++;
    b--;
  }
  printf("%d %d\n", a, b);
  if (!a && !b)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
