#P3531. Match

    ID: 2415 远端评测题 1000ms 32MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2010 ACM-ICPC Multi-University Training Contest(10)——Host by HEU

Match

Problem Description

There is a matrix of size n*n whose elements are either 0 or 1. Now your task is to find out that given a matrix of size m*m whose elements are also 0 or 1 whether it is a sub-matrix of the previous matrix.

Input

There is a matrix of size n*n whose elements are either 0 or 1. Now your task is to find out that given a matrix of size m*m whose elements are also 0 or 1 whether it is a sub-matrix of the previous matrix.

Output

If the second matrix is a sub-matrix of the first one, print “Yes” on a single line. Otherwise print “No”.

4 2 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 1 0 0 0 3 2 0 0 1 0 1 0 1 0 0 0 0 1 1
Yes No