{"raw_statement":[{"iden":"statement","content":"Polycarp is a beginner programmer. He is studying how to use a command line.\n\nPolycarp faced the following problem. There are _n_ files in a directory and he needs to delete some of them. Polycarp wants to run a single delete command with filename pattern as an argument. All the files to be deleted should match the pattern and all other files shouldn't match the pattern.\n\nPolycarp doesn't know about an asterisk '_*_', the only special character he knows is a question mark '_?_' which matches any single character. All other characters in the pattern match themselves only.\n\nFormally, a pattern matches a filename if and only if they have equal lengths and all characters in the corresponding positions are equal except when the character in the pattern is '_?_', in which case the corresponding filename character does not matter.\n\nFor example, the filename pattern \"_a?ba?_\":\n\n*   matches filenames \"_aabaa_\", \"_abba._\", \"_a.ba9_\" and \"_a.ba._\";\n*   does not match filenames \"_aaba_\", \"_abaab_\", \"_aabaaa_\" and \"_aabaa._\".\n\nHelp Polycarp find a pattern which matches files to be deleted and only them or report if there is no such pattern."},{"iden":"input","content":"The first line of the input contains two integers _n_ and _m_ (1 ≤ _m_ ≤ _n_ ≤ 100) — the total number of files and the number of files to be deleted.\n\nThe following _n_ lines contain filenames, single filename per line. All filenames are non-empty strings containing only lowercase English letters, digits and dots ('_._'). The length of each filename doesn't exceed 100. It is guaranteed that all filenames are distinct.\n\nThe last line of the input contains _m_ distinct integer numbers in ascending order _a_1, _a_2, ..., _a__m_ (1 ≤ _a__i_ ≤ _n_) — indices of files to be deleted. All files are indexed from 1 to _n_ in order of their appearance in the input."},{"iden":"output","content":"If the required pattern exists, print \"_Yes_\" in the first line of the output. The second line should contain the required pattern. If there are multiple solutions, print any of them.\n\nIf the required pattern doesn't exist, print the only line containing \"_No_\"."},{"iden":"examples","content":"Input\n\n3 2\nab\nac\ncd\n1 2\n\nOutput\n\nYes\na?\n\nInput\n\n5 3\ntest\ntezt\ntest.\n.est\ntes.\n1 4 5\n\nOutput\n\nYes\n?es?\n\nInput\n\n4 4\na\nb\nc\ndd\n1 2 3 4\n\nOutput\n\nNo\n\nInput\n\n6 3\n.svn\n.git\n....\n...\n..\n.\n1 2 3\n\nOutput\n\nYes\n.???"}],"translated_statement":[{"iden":"statement","content":"Polycarp 是一名编程初学者。他正在学习如何使用命令行。\n\nPolycarp 遇到了以下问题：一个目录中有 #cf_span[n] 个文件，他需要删除其中一些。Polycarp 希望使用一个带有文件名模式参数的删除命令来一次性完成删除。所有需要删除的文件都必须匹配该模式，而其他所有文件都不应匹配该模式。\n\nPolycarp 不知道星号 '_*_'，他只知道一个特殊字符：问号 '_?_'，它可以匹配任意单个字符。模式中的所有其他字符仅匹配自身。\n\n形式上，一个模式匹配一个文件名，当且仅当它们长度相等，且对应位置的所有字符都相等，除非模式中的字符是 '_?_'，此时文件名中对应位置的字符可以是任意字符。\n\n例如，文件名模式 \"_a?ba?_\":\n\n帮助 Polycarp 找到一个模式，使其恰好匹配需要删除的文件，而不匹配其他文件；如果不存在这样的模式，请报告出来。\n\n输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m]（#cf_span[1 ≤ m ≤ n ≤ 100]）——文件总数和需要删除的文件数。\n\n接下来的 #cf_span[n] 行包含文件名，每行一个文件名。所有文件名都是非空字符串，仅包含小写英文字母、数字和点（'_._'）。每个文件名的长度不超过 100。保证所有文件名互不相同。\n\n输入的最后一行包含 #cf_span[m] 个按升序排列的互不相同的整数 #cf_span[a1, a2, ..., am]（#cf_span[1 ≤ ai ≤ n]）——需要删除的文件的索引。所有文件按输入顺序从 #cf_span[1] 到 #cf_span[n] 编号。\n\n如果存在所需的模式，第一行输出 \"_Yes_\"，第二行输出该模式。如果有多个解，输出任意一个即可。\n\n如果不存在所需的模式，仅输出一行 \"_No_\"。\n"},{"iden":"input","content":"输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m]（#cf_span[1 ≤ m ≤ n ≤ 100]）——文件总数和需要删除的文件数。接下来的 #cf_span[n] 行包含文件名，每行一个文件名。所有文件名都是非空字符串，仅包含小写英文字母、数字和点（'_._'）。每个文件名的长度不超过 100。保证所有文件名互不相同。输入的最后一行包含 #cf_span[m] 个按升序排列的互不相同的整数 #cf_span[a1, a2, ..., am]（#cf_span[1 ≤ ai ≤ n]）——需要删除的文件的索引。所有文件按输入顺序从 #cf_span[1] 到 #cf_span[n] 编号。"},{"iden":"output","content":"如果存在所需的模式，第一行输出 \"_Yes_\"，第二行输出该模式。如果有多个解，输出任意一个即可。如果不存在所需的模式，仅输出一行 \"_No_\"。"},{"iden":"examples","content":"输入\n3 2\naba\ncc\nd\n1 2\n输出\nYes\na?\n\n输入\n5 3\ntest\ntezt\ntest.\n.est\ntes.\n1 4 5\n输出\nYes\n?es?\n\n输入\n4 4\nabcd\nd\n1 2 3 4\n输出\nNo\n\n输入\n6 3\n.svn\n.git\n.\n.\n.\n.\n1 2 3\n输出\nYes\n.???"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z} $ with $ 1 \\leq m \\leq n \\leq 100 $.  \nLet $ F = (f_1, f_2, \\dots, f_n) $ be a sequence of distinct filenames, where each $ f_i $ is a string over the alphabet $ \\Sigma = \\{ \\text{lowercase letters}, \\text{digits}, '.' \\} $ and $ 1 \\leq |f_i| \\leq 100 $.  \nLet $ D = \\{ a_1, a_2, \\dots, a_m \\} \\subseteq \\{1, 2, \\dots, n\\} $ be the set of indices of files to be deleted, with $ a_1 < a_2 < \\dots < a_m $.  \nLet $ D_f = \\{ f_{a_i} \\mid i \\in \\{1, \\dots, m\\} \\} $ be the set of files to delete.  \nLet $ R_f = F \\setminus D_f $ be the set of files to retain.\n\n**Constraints**  \n1. All filenames in $ F $ are distinct.  \n2. All filenames have lengths at most 100.  \n3. For any two filenames $ f_i, f_j \\in F $, if $ f_i \\neq f_j $, then $ |f_i| \\neq |f_j| $ or $ f_i \\neq f_j $ as strings.  \n\n**Objective**  \nFind a pattern $ p $ over the alphabet $ \\Sigma \\cup \\{?\\} $ such that:  \n- For every $ f \\in D_f $: $ \\text{match}(p, f) = \\text{true} $,  \n- For every $ f \\in R_f $: $ \\text{match}(p, f) = \\text{false} $,  \n\nwhere $ \\text{match}(p, f) = \\text{true} $ if and only if:  \n- $ |p| = |f| $, and  \n- For all positions $ j \\in \\{1, \\dots, |p|\\} $, either $ p_j = f_j $ or $ p_j = ? $.  \n\nIf such a pattern exists, output \"Yes\" followed by one such pattern; otherwise, output \"No\".","simple_statement":null,"has_page_source":false}