#include<iostream>
using namespace std;

bool search(int);

int q,T[500];

int main(){

  int n,S[10000],counter=0;

  cin >>n;
  for(int i=0 ; i < n ; i++)cin >>S[i];

  cin >>q;
  for(int i=0 ; i < q ; i++)cin >>T[i];

  for(int i=0 ; i < n ; i++)counter+=search(S[i]);

  cout <<counter<<endl;

  return 0;
}

bool search(int s){

  for(int i=0 ; i < q ; i++){
    if( s == T[i] ){
      T[i]=-1;
      return 1;
    }
  }
  
  return 0;

}
#include <bits/stdc++.h>

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

using namespace std;
// using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef map<int, int> mpii;
typedef set<int> seti;

const int mxN = 2e5, iinf = 1e9 + 10, inf = 1e18 + iinf + 10, mod = 1000000007;
const ld pi = 4.0 * atanl(1.0), prec = .000001;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(c) c.begin(), c.end()
#define rall(c) c.end(), c.begin()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)

int n, m, t, a[mxN];

void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }

int main() {
  fast();
  cin >> n >> m;
  string s;
  cin >> s;
  if (s.size() < n + m + 1) {
    cout << "No";
    return 0;
  }
  if (s[n] != '-') {
    cout << "No";
    return 0;
  }
  for (int i = 0; i < s.size(); ++i) {
    if (i != n) {
      if (!isdigit(s[i])) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";

  return 0;
}

