#include <bits/stdc++.h>
int main() {
  int a, b, i, t = 1;
  char c, d[5], e[5];
  scanf("%d %d", &a, &b);
  for (i = 0; i < a; i++) {
    scanf("%c", &d[i]);
    if (d[i] < '0' || d[i] > '9') t = 0;
  }
  c = getchar();
  if (c != '-') t = 0;
  for (i = 0; i < b; i++) {
    scanf("%c", &e[i]);
    if (e[i] < '0' || e[i] > '9') t = 0;
  }
  printf("%s", t ? "Yes" : "No");
  return 0;
}
