/*Based on the question at the link:
https://www.hackerrank.com/challenges/ctci-ransom-note
*/
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int m = in.nextInt();
        int n = in.nextInt();
        
        if(m<n){
            System.out.println("No");
            return;
        }
        
        HashMap<String,Integer> magazine = new HashMap<String,Integer>();
        for(int magazine_i=0; magazine_i < m; magazine_i++){
            String s = in.next();
            if(magazine.containsKey(s)){
                magazine.put(s, magazine.get(s)+1);
            }
            else{
                magazine.put(s, 1);
            }
        }
        
        for(int ransom_i=0; ransom_i < n; ransom_i++){
            String s = in.next();
            if(!magazine.containsKey(s)){
                System.out.println("No");
                return;
            }
            else{
                int count = magazine.get(s);
                magazine.put(s, --count);
                if(count<0){
                    System.out.println("No");
                    return;
                }
            }
        }
        System.out.println("Yes");
    }
}

@@ -210,16 +210,18 @@
 ass 
-Solution
+RansomNote
  %7B%0A%0A
@@ -265,16 +265,55 @@
 args) %7B%0A
+        Solution sln = new Solution();%0A
         
@@ -867,32 +867,77 @@
      %7D%0A        %0A
+        sln.printMap(magazine, -1);%0A        %0A
         for(int 
@@ -1214,31 +1214,39 @@
     
-magazine.put(s, --count
+sln.printMap(magazine, ransom_i
 );%0A 
@@ -1357,32 +1357,74 @@
               %7D%0A
+                magazine.put(s, --count);%0A
             %7D%0A  
@@ -1472,10 +1472,265 @@
 ;%0A    %7D%0A
+    %0A    void printMap(HashMap%3CString, Integer%3E h, int i)%7B%0A        System.out.println(%22%5CnLoop:%22+i);%0A        for (HashMap.Entry%3CString, Integer%3E entry : h.entrySet()) %7B%0A            System.out.println(entry.getKey()+%22 : %22+entry.getValue());%0A        %7D%0A    %7D%0A
 %7D%0A

Update RansomNote.java