#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  string s;
  cin >> a >> b >> s;
  if (s.length() != (a + b + 1) || s.at(a) != '-' || a > 5 || a < 1 || b > 5 ||
      b < 1)
    cout << "No" << endl;
  else {
    for (int i = 0; i < s.length(); i++) {
      if (s.at(i) == a)
        continue;
      else {
        if (s.at(i) == '0' || s.at(i) == '1' || s.at(i) == '2' ||
            s.at(i) == '3' || s.at(i) == '4' || s.at(i) == '5')
          cout << "Yes" << endl;
        else {
          cout << "No" << endl;
          break;
        }
      }
    }
  }
}
