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.

Login 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: 
 -  transform lowercase letters to uppercase and vice versa; -  change letter «O» (uppercase latin letter) to digit «0» and vice versa; -  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. 
For example, logins «Codeforces» and «codef0rces» as well as «OO0OOO00O0OOO0O00OOO0OO_lol» and «OO0OOO0O00OOO0O00OO0OOO_1oI» are considered similar whereas «Codeforces» and «Code_forces» are not.

You'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.
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.

The second line contains a single integer *n* (1 ≤ *n* ≤ 1 000) — the number of existing logins.

The 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.
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.

In the third sample case the new login is similar with the second one.
1_wat
2
2_wat
wat_1
Yes
000
3
00
ooA
oOo
No
_i_
3
__i_
_1_
I
No
La0
3
2a0
La1
1a0
No
abc
1
aBc
No
0Lil
2
LIL0
0Ril
Yes
iloO
3
iIl0
oIl0
IooO
Yes
L1il0o1L1
5
iLLoLL
oOI1Io10il
IoLLoO
O01ilOoI
I10l0o
Yes
ELioO1lOoOIOiLoooi1iolul1O
7
OoEIuOIl1ui1010uiooOoi0Oio001L0EoEolO0
OLIoOEuoE11u1u1iLOI0oO
uEOuO0uIOOlO01OlEI0E1Oo0IO1LI0uE0LILO0
EOo0Il11iIOOOIiuOiIiiLOLEOOII001EE
iOoO0LOulioE0OLIIIulli01OoiuOOOoOlEiI0EiiElIIu0
lE1LOE1Oil
1u0EOliIiIOl1u110il0l1O0u
Yes
0blo7X
20
1oobb6
XIXIO2X
2iYI2
607XXol
2I6io22
Ol10I
bXX0Lo
olOOb7X
07LlXL
lXY17
12iIX2
7lL70
bOo11
17Y6b62
0O6L7
1lX2L
2iYl6lI
7bXIi1o
iLIY2
0OIo1X
Yes
lkUL
25
IIfL
okl
foo
i0U
oko
iIoU
UUv
vli
v0Uk
0Of
iill
1vkl
UIf
UfOO
lvLO
UUo0
IOf1
lovL
Ikk
oIv
LvfU
0UI
kol
1OO0
1OOi
Yes
L1lo
3
OOo1
L1lo
0lOl
No
LIoooiLO
5
LIoooiLO
l0o01I00
0OOl0lLO01
il10i0
oiloi
No
1i1lQI
7
uLg1uLLigIiOLoggu
LLLgIuQIQIIloiQuIIoIO0l0o000
0u1LQu11oIuooIl0OooLg0i0IQu1O1lloI1
QuQgIQi0LOIliLOuuuioLQou1l
lLIO00QLi01LogOliOIggII1
o0Ll1uIOQl10IL0IILQ
1i1lQI
No
oIzz1
20
1TTl0O
loF0LT
1lLzo
oi0Ov
FlIF1zT
zoITzx
0TIFlT
l1vllil
Oviix1F
LFvI1lL
LIl0loz
ixz1v
1i1vFi
TIFTol
oIzz1
IvTl0o
xv1U0O
iiiioF
1oiLUlO
xToxv1
No
00L0
25
0il
IlkZ
L0I
00L0
Bd0
ZLd
0d1k
ddk
Idl
kBd
kBOL
Z1lI
kBL
LOko
oZ0i
Z1lO
LiOk
iBld
LO0d
dIo
Z10
1k1i
0o0L
IoBd
i0B0
No
Z
1
z
No
0
1
o
No
0
1
O
No
o
1
0
No
o
1
O
No
o
1
o
No
O
1
o
No
O
1
0
No
1
1
l
No
1
1
L
No
1
1
i
No
1
1
I
No
1
1
o
Yes
i
1
1
No
i
1
L
No
i
1
l
No
I
1
L
No
I
1
l
No
I
1
1
No
l
1
1
No
l
1
L
No
l
1
i
No
l
1
I
No
L
1
l
No
L
1
1
No
L
1
i
No
L
1
I
No
def rep(data):
    data = data.replace("0", "@@@")
    data = data.replace("o", "@@@")
    data = data.replace("1", "!!!")
    data = data.replace("l", "!!!")
    data = data.replace("i", "!!!")
    return data


login_usr = rep(input().lower())
count_log = int(input())
data_log = list(map(rep, [input().lower() for i in range(count_log)]))
for data in data_log:
    if data == login_usr:
        count_log = 0
        break
    else:
        count_log = 1
if count_log:
    print("Yes")
else:
    print("No")
