#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  char ch;
  cin >> a >> b;
  ;
  for (int i = 0; i < a; i++) {
    ch = getchar();
    if (ch < '0' || ch > '9') {
      printf("No\n");
      return 0;
    }
  }
  ch = getchar();
  if (ch != '\n') {
    printf("No\n");
    return 0;
  }
  for (int i = 0; i < b; i++) {
    ch = getchar();
    if (ch < '0' || ch > '9') {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
