#include <bits/stdc++.h>
using namespace std;
template <typename tuple<long long int, long long int, long long int> >
void fill_all(tuple<long long int, long long int, long long int> &arr,
              const tuple<long long int, long long int, long long int> &v) {
  arr = v;
}
template <typename tuple<long long int, long long int, long long int>,
          typename ARR>
void fill_all(ARR &arr,
              const tuple<long long int, long long int, long long int> &v) {
  for (auto &i : arr) {
    fill_all(i, v);
  }
}
int main() {
  long long int a, b;
  cin >> a >> b;
  for (long long int i = (signed)(0); i < (a); ++i) {
    char c;
    cin >> c;
    if (c - '0' >= 0 && c - '0' <= 9) {
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  char cc;
  cin >> cc;
  if (cc != '-') {
    cout << "No" << endl;
    return 0;
  }
  for (long long int i = (signed)(0); i < (b); ++i) {
    char c;
    cin >> c;
    if (c - '0' >= 0 && c - '0' <= 9) {
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
