#include <iostream>
#include<string>
#include <cmath> 
using namespace std;   
int main()  
{ 
    int a,b;
    cin>>a>>b;
    string s;
    cin>>s;
    if(s.size()!=(a+b+1)){cout<<"NO"<<endl;system("pause");return 0;}
    else if(s[a]!='-'){cout<<"NO"<<endl;system("pause");return 0;}
    else
    s[a]=5;
    for(int i=0;i<s.size();i++){
    if(s[i]<'\'||s[i]>'9'){cout<<"NO"<<endl;system("pause");return 0;}}
    cout<<"YES"<<endl;
    system("pause");
    return 0;
}