{"raw_statement":[{"iden":"statement","content":"When registering in a social network, users are allowed to create their own convenient login to make it easier to share contacts, print it on business cards, etc.\n\nLogin is an arbitrary sequence of lower and uppercase latin letters, digits and underline symbols («___»). However, in order to decrease the number of frauds and user-inattention related issues, it is prohibited to register a login if it is _similar_ with an already existing login. More precisely, two logins _s_ and _t_ are considered similar if we can transform _s_ to _t_ via a sequence of operations of the following types:\n\n*   transform lowercase letters to uppercase and vice versa;\n*   change letter «_O_» (uppercase latin letter) to digit «_0_» and vice versa;\n*   change digit «_1_» (one) to any letter among «_l_» (lowercase latin «_L_»), «_I_» (uppercase latin «_i_») and vice versa, or change one of these letters to other.\n\nFor example, logins «_Codeforces_» and «_codef0rces_» as well as «_OO0OOO00O0OOO0O00OOO0OO_lol_» and «_OO0OOO0O00OOO0O00OO0OOO_1oI_» are considered similar whereas «_Codeforces_» and «_Code_forces_» are not.\n\nYou're given a list of existing logins with no two _similar_ amonst and a newly created user login. Check whether this new login is _similar_ with any of the existing ones."},{"iden":"input","content":"The first line contains a non-empty string _s_ consisting of lower and uppercase latin letters, digits and underline symbols («___») with length not exceeding 50 — the login itself.\n\nThe second line contains a single integer _n_ (1 ≤ _n_ ≤ 1 000) — the number of existing logins.\n\nThe next _n_ lines describe the existing logins, following the same constraints as the user login (refer to the first line of the input). It's guaranteed that no two existing logins are similar."},{"iden":"output","content":"Print «_Yes_» (without quotes), if user can register via this login, i.e. none of the existing logins is _similar_ with it.\n\nOtherwise print «_No_» (without quotes)."},{"iden":"examples","content":"Input\n\n1_wat\n2\n2_wat\nwat_1\n\nOutput\n\nYes\n\nInput\n\n000\n3\n00\nooA\noOo\n\nOutput\n\nNo\n\nInput\n\n_i_\n3\n__i_\n_1_\nI\n\nOutput\n\nNo\n\nInput\n\nLa0\n3\n2a0\nLa1\n1a0\n\nOutput\n\nNo\n\nInput\n\nabc\n1\naBc\n\nOutput\n\nNo\n\nInput\n\n0Lil\n2\nLIL0\n0Ril\n\nOutput\n\nYes"},{"iden":"note","content":"In the second sample case the user wants to create a login consisting of three zeros. It's impossible due to collision with the third among the existing.\n\nIn the third sample case the new login is similar with the second one."}],"translated_statement":[{"iden":"statement","content":"在注册社交网络时，用户可以创建自己方便的登录名，以便于分享联系人、打印在名片上等。\n\n登录名是由小写和大写拉丁字母、数字和下划线符号（«_»）组成的任意序列。然而，为了减少欺诈和用户疏忽相关的问题，如果一个登录名与已存在的登录名 _相似_，则禁止注册。更准确地说，两个登录名 #cf_span[s] 和 #cf_span[t] 被认为是相似的，如果可以通过以下类型的操作序列将 #cf_span[s] 转换为 #cf_span[t]：\n\n例如，登录名 «_Codeforces_» 和 «_codef0rces_» 以及 «_OO0OOO00O0OOO0O00OOO0OO_lol_» 和 «_OO0OOO0O00OOO0O00OO0OOO_1oI_» 被认为是相似的，而 «_Codeforces_» 和 «_Code_forces_» 则不是。\n\n你被给定一个已存在登录名的列表，其中任意两个均不 _相似_，以及一个新创建的用户登录名。请检查这个新登录名是否与任何一个已存在的登录名 _相似_。\n\n第一行包含一个非空字符串 #cf_span[s]，由小写和大写拉丁字母、数字和下划线符号（«_»）组成，长度不超过 #cf_span[50] —— 即登录名本身。\n\n第二行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 1 000]）—— 已存在登录名的数量。\n\n接下来的 #cf_span[n] 行描述已存在的登录名，其约束条件与用户登录名相同（参见输入的第一行）。保证任意两个已存在的登录名均不相似。\n\n如果用户可以使用此登录名注册，即没有任何一个已存在的登录名与其 _相似_，则输出 «_Yes_»（不含引号）。\n\n否则输出 «_No_»（不含引号）。\n\n在第二个样例中，用户想创建一个由三个零组成的登录名。由于与已存在的第三个登录名冲突，因此无法注册。\n\n在第三个样例中，新登录名与第二个登录名相似。"},{"iden":"input","content":"第一行包含一个非空字符串 #cf_span[s]，由小写和大写拉丁字母、数字和下划线符号（«_»）组成，长度不超过 #cf_span[50] —— 即登录名本身。第二行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 1 000]）—— 已存在登录名的数量。接下来的 #cf_span[n] 行描述已存在的登录名，其约束条件与用户登录名相同（参见输入的第一行）。保证任意两个已存在的登录名均不相似。"},{"iden":"output","content":"如果用户可以使用此登录名注册，即没有任何一个已存在的登录名与其 _相似_，则输出 «_Yes_»（不含引号）。否则输出 «_No_»（不含引号）。"},{"iden":"examples","content":"输入1_wat22_watwat_1输出Yes输入000300ooAoOo输出No输入_i_3__i__1_I输出No输入La032a0La11a0输出No输入abc1aBc输出No输入0Lil2LIL00Ril输出Yes"},{"iden":"note","content":"在第二个样例中，用户想创建一个由三个零组成的登录名。由于与已存在的第三个登录名冲突，因此无法注册。在第三个样例中，新登录名与第二个登录名相似。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ S $ be the user login string.  \nLet $ L = \\{l_1, l_2, \\dots, l_n\\} $ be the set of existing logins, where each $ l_i $ is a string over the alphabet $ \\Sigma = \\{a,\\dots,z, A,\\dots,Z, 0,\\dots,9, \\_\\} $.  \n\nDefine an equivalence relation $ \\sim $ on $ \\Sigma^* $ such that two strings $ x, y \\in \\Sigma^* $ are similar ($ x \\sim y $) if one can be transformed into the other via a sequence of the following operations:  \n- Replace any lowercase letter with its uppercase equivalent (and vice versa).  \n- Replace digit `0` with letter `O` (and vice versa).  \n- Replace digit `1` with letter `l` (and vice versa).  \n\n**Constraints**  \n1. $ |S| \\leq 50 $  \n2. $ 1 \\leq n \\leq 1000 $  \n3. $ \\forall i,j \\in \\{1,\\dots,n\\}, i \\ne j \\Rightarrow l_i \\not\\sim l_j $  \n\n**Objective**  \nDetermine whether $ S \\sim l_i $ for any $ i \\in \\{1, \\dots, n\\} $.  \nOutput \"Yes\" if $ \\forall i \\in \\{1,\\dots,n\\}, S \\not\\sim l_i $; otherwise output \"No\".","simple_statement":null,"has_page_source":false}