#include <bits/stdc++.h>
int main(void) {
  int a, b, ss, i;
  int s[100000000];
  scanf("%d", &a);
  scanf("%d", &b);
  ss = a + b + 1;
  for (i = 0; i < ss; i++) {
    scanf("%d", &s[i]);
  }
  if (s[a + 1] == '-')
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
