#include <bits/stdc++.h>
const double EPS = 1e-10;
const double PI = acos(-1);
const long long INF = 1 << 30;
int main(int argc, char* argv[]) {
  int a, b;
  std::string s;
  std::string::iterator it;
  std::cin >> a >> b;
  std::cin >> s;
  std::string x = s.substr(0, a);
  std::string y = s.substr(a + 1);
  std::string judge = "Yes";
  std::cout << x.size() << " " << y.size() << std::endl;
  if (s[a] != '-') {
    judge = "No";
  }
  if ((int)x.size() != a || (int)y.size() != b) {
    judge = "No";
  }
  for (it = x.begin(); it != x.end(); it++) {
    if (*it > '9' || *it < '0') {
      judge = "No";
    }
  }
  for (it = y.begin(); it != y.end(); it++) {
    if (*it > '9' || *it < '0') {
      judge = "No";
    }
  }
  std::cout << judge << std::endl;
  return 0;
}
