Random is magic.
給你 n 個整數 a1...an 跟 m 個整數 b1...bm,令 A=a1! × ... ×an! , B=b1! × ... ×bm!,若 B|A 輸出 "Yes",否則輸出 "No"。
第一行有兩個整數n,m。 第二行有n個整數a1...an。 第三行有m個整數b1...bm。 n,m≤106, ai,bi≤107
輸出一行"Yes"或"No"。
Sample Input 1: 2 1 5 5 6 Sample Input 2: 1 2 3 2 2
Sample Output 1: Yes Sample Output 2: No