#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  char c;
  while (cin >> a >> b) {
    int a1, a2;
    cin >> a1 >> c >> a2;
    int cn1 = 0, cn2 = 0;
    if (c != '-' || a < 1 || a > 5 || b < 1 || b > 5) {
      cout << "No" << endl;
      continue;
    }
    while (a1) {
      a1 = a1 / 10;
      cn1++;
    }
    while (a2) {
      a2 = a2 / 10;
      cn2++;
    }
    if (cn1 == a && cn2 == b)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
