#!/bin/python3

from collections import defaultdict 

def checkMagazine(magazine, note):
    word_count = defaultdict(int)
    for w in magazine:        
        word_count[w] += 1
    for w in note:
        if word_count[w] == 0:
            print("No")
            return
        word_count[w] -= 1
    print("Yes")

from collections import Counter

def checkMagazine(magazine, note):
    if (Counter(note) - Counter(magazine)) == {}:
        print("Yes")
    else:
        print("No")


# C++
void checkMagazin(vector<string> magazine, vector<string> note) {
    unordered_map<string,int> word_count;
    for (auto w : magazine) word_count[w]++;
    for (auto w : note) {
        if (word_count[w] == 0) {
            cout << "No" << endl;
            return;
        }
        word_count[w]--;
    }
    cout << "Yes" << endl;
}
