#include<bits/stdc++.h>
using namespace std;
int main(){
	char s;
	bool fl=true;
	int a,b;
	cin>>a>>b;
	while(a--){
		cin>>s;
		if(s=='-') fl=false;
	}
	cin>>s;
	if(s!='-') fl=false;
	while(b--){
		cin>>s;
		if(s=='-') fl=false;
	}
	cout<<(fl?"Yes\n":"No\n");
    return 0;
}