#include <bits/stdc++.h>
int len(int n) { return n == 0 ? 0 : len(n / 10) + 1; }
int main() {
  int n, n_, a, b;
  scanf("%d%d%d-%d", &a, &b, &n, &n_);
  printf(len(n) == a && len(n_) == b ? "Yes\n" : "No\n");
  return 0;
}
