#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
int main() {
  int N, M;
  string S;
  cin >> N >> M >> S;
  if (S[N] != '-') {
    cout << "NO" << endl;
    return 0;
  }
  S.erase(begin(S) + N);
  for (auto &x : S) {
    if (!iswdigit(x)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
