#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  char c;
  for (int i = 0; i < a; i++) {
    cin >> c;
    if (c < '0' || c > '9') {
      cout << "NO\n";
      return 0;
    }
  }
  cin >> c;
  if (c != '-') {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= b; i++) {
    cin >> c;
    if (c < '0' || c > '9') {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
