#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  int count = 0;
  string c[114514];
  cin >> a >> b;
  for (int i = 1; i < a + b + 1; i++) {
    cin >> c[i];
    count++;
  }
  if (c[a + 1] == "-") {
    if (count == b - a) {
      cout << "Yes" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
