#include <bits/stdc++.h>
using namespace std;
int main(){
  char a[20];
  int A,B;
  cin >>A>>B;
  int(int i = 0;i < A+B+1;i++){
    cin >> char a[i];
  }
  if(char a[A+1] == '-' && a[A-1] != '-' && a[B-1] != '-') cout <<"Yes"<<endl;
  else cout <<"No"<<endl;
  return 0;
}
  