#include<iostream>
using namespace std;
 
int main(){
 int a, b;
 cin >> a >> b >> endl;
 string s[8];
 for(int k=0; k<8; k++){
  cin >> s[k]; 
 }
 if(s[3]=="-"){
 	cout << "Yes" << endl;
 }else{
   	cout << "No" << endl; 
 }
  
  
  return 0;
}