Problem:


Score : 100 points

Problem Statement

You are given three strings A, B and C. Check whether they form a word chain.

More formally, determine whether both of the following are true:

The last character in A and the initial character in B are the same.

The last character in B and the initial character in C are the same.

If both are true, print YES. Otherwise, print NO.

Constraints

A, B and C are all composed of lowercase English letters (a - z).

1 ≤ |A|, |B|, |C| ≤ 10, where |A|, |B| and |C| are the lengths of A, B and C, respectively.

Input

Input is given from Standard Input in the following format:

A B C

Output

Print YES or NO.

Sample Input 1

rng gorilla apple

Sample Output 1

YES

They form a word chain.

Sample Input 2

yakiniku unagi sushi

Sample Output 2

NO

A and B form a word chain, but B and C do not.

Sample Input 3

a a a

Sample Output 3

YES

Sample Input 4

aaaaaaaaab aaaaaaaaaa aaaaaaaaab

Sample Output 4

NO



Sample input:
rng gorilla apple


Sample output:
YES

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def iroha():
    a, b, c = input().split()
    
    s = a[len(a)-1]
    sshead = b[0]
    sstail = b[len(b)-1]
    sss = c[0]

    if s == sshead and sstail and sss:
        print("YES")
    else:
        print("NO")





if __name__ == "__main__":
    iroha()

Submission status: Wrong Answer

Solution code:
#答えはあってるけどWA
A, B, C = input().split()

if A[-1]==B[0] and B[-1]==C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if (1<=len(A) and len(A)<=10 and A.islower()) and (1<=len(B) and len(B)<=10 and B.islower())\
        and (1<=len(C) and len(C)<=10 and C.islower()):
    if (A[len(A) - 1] == B[0]) and (A[0] == B[len(B) - 1]):
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
if (A[len(A)-1]==B[0])and(A[0]==B[len(B)-1]):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()

def answer(A, B , C) -> str:
    if A[-1] == B[0] and B[-1]== C[0]:
        return('Yes')
    else:
        return('No')
print(answer(A, B, C))

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if list(A[-1])==list(B[0]) and list(B[-1])==list(C[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()

if A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# 数値を取得
A,B,C = map(str,input().split())
cnt = 3

# 語頭語尾の抽出及び検査結果出力し重複削除
set_list = set([A[-1],B[0],B[-1],C[0],C[-1]])

# 検査結果を出力
if len(set_list) == cnt:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# 数値を取得
A,B,C = map(str,input().split())
cnt = 3

# 語頭語尾の抽出及び検査結果出力し重複削除
set_list = set([A[-1],B[0],B[-1],C[0],C[-1]])

# 検査結果を出力
if len(set_list) == cnt:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B,C = map(str,input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())

if a[-1] == b[-1] and b[-1] == c[-1]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
l = list(input().split())

if l[0][-1] == l[1][0] and l[1][-1] and l[2][0]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
n = 0
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())
if a == b and b == c:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print(a,b,c)
print(['NO','YES'][a[-1]==b[0]and b[-1]==c[0]])

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[:-1]==b[0] and b[:-1]==c[0]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = map(str, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    print('YES')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a = [str(i) for i in input().split()]
if a[0][-1] == a[1][0] and a[1][-1] == a[2][0]:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print("Yes" if a[-1]==b[0] and b[-1]==c[0] else "No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print ("Yes") if a[-1] == b[0] and b[-1] == c[0] else print ("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print('NYoe s'[a[-1]==b[0] and b[-1]==c[0]::2])

Submission status: Wrong Answer

Solution code:
a=input()

b=a.split(' ')

if b[0][-1]==b[1][0] and b[1][-1]==b[2][0]:
  print('YES')
else:
  print('N0')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if a[-1] == b[0]:
    if b[-1] == c[0]:
        print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print("YNeos"[a[-1]!=b[0]or b[-1]!=c[0]::2])

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A,B,C =map(str,input().split())


if A[-1] == B[0]:
    if B[-1] == C[0]:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A,B,C = map(str,input().split())

flag = True
if A[-1] != B[0]:
    flag = False

if B[-1] == C[0]:
    flag = False

if flag:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
lis = input().split()
lis_a = lis[0][len(lis[0])-1]
lis_b = lis[1][len(lis[1])-1]
lis_c = lis[2][len(lis[2])-1]

if lis_a == lis_b and lis_b == lis_c:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] == C[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print("YNEOS"[a[-1]==b[0]and b[-1]==c[0]])

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()
print(['No', 'Yes'][A[-1] == B[0] and B[-1] == C[0]])

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(str, input().split()))

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(str,input().split())

if a[-1] == b[0] and b[-1] == c[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
a,b=len(A),len(B)
if(A[a-1]==B[0] and B[b-1]==C[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1]==b[-1] and b[-1]==c[-1]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print(a[0].upper() + b[0].upper() + c[0].upper())

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split();print('YNeos'[A[-1]!=B[0]or B[-1]!=C[0]::2])

Submission status: Wrong Answer

Solution code:
A, B, C = raw_input().split()
if A[-1] == B[0] and B[-1] == C[0]:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
a, b, c = raw_input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print "Yes"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
A=list(map(str, input().split()))
a=['']*3
b=['']*10
tmp1=''
tmp2=''
p=0
for i in range(3):
    a[i]=list(A[i])
    #print(a[i])
    if i!=0:
        a[0]=tmp2
    if tmp1!='':
        #print(tmp1,tmp2)
        if tmp1!=tmp2:
            p=1
    a[i]=list(reversed(a[i]))
    #print(a[i])
    b=list(a[i])
    #print(b[0])
    tmp1=b[0]
    #print(tmp1)
if p==0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A=list(map(str, input().split()))
a=['']*3
b=['']*10
tmp1=''
tmp2=''
p=0
for i in range(3):
    a[i]=list(A[i])
    if i!=0:
        a[0]=tmp2
    if tmp1!='':
        if tmp1!=tmp2:
            p=1
    a[i]=reversed(a[i])
    b[i]=list(a[i])
    b[0]=tmp1
if p==0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c = map(str,input().split())
a = list(a)
b = list(b)
c = list(c)

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#abc060 a 
s=list(input().split())
if s[0][-1]==s[1][0] and s[1][-1]==s[2][0]:
    print("YES")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = list(input().split())
print('Yes' if a[len(a)-1] == b[0] and b[len(b)-1] == c[0] else 'No')

Submission status: Wrong Answer

Solution code:
x = [i for i in input().split()]
torf = [x[0][-1] == x[1][0] and x[1][-1] == x[2][0]]
print("YES" if torf==True else "NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[0]==b[0] and b[-1]==c[0]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=map(str,input().split())
#print(sorted(B)[0])
if sorted(A)[0]==B[0] and sorted(B)[0]==C[0]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] == C[0]:
    print("YES")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print('YNeos'[a[-1]!=b[0]or b[-1]!=c[0]::2])

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print('YNeos'[a[-1]!=b[0] or b[-1]!=c[0]::2])

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print('YNeos'[a[-1]!=b[0]or b[-1]!=c[0]::2])

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()
a = A[len(A)-1]
b = B[0]
c = B[len(B)-1]
d = c[0]
if a == b and c == d:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(str, input().split()))
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("YES")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1]==b[0]:
    if b[-1]==c[0]:
         print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[-1]==b[0]:
    if b[-1]==c[0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[-1]==b[0]:
    if b[-1]==c[0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = map(str, input().split())
if a[-1] == b[0] and b[-1] and c[0]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
print("YES" if a[0] == b[-1] and b[-1] == c[0] else "NO")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
print('Yes' if a[-1:]==b[:1] and b[-1:]==c[0:1] else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
print('Yes' if a[-1:]==b[0:] and b[-1:]==c[0:] else 'No')

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())
print("Yes" if a[-1] == b[0] and b[-1] == c[0] else "No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
A, B, C=input().split(" ")
print("Yes" if ((A[-1]==B[0])and(B[-1]==C[0])) else "No")

Submission status: Wrong Answer

Solution code:
# ABC060a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = input().split()
print('YNEOS'[a[-1] != b[0] and b[-1] != c[0]::2])

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[:-1]==b[0] and b[:-1]==c[0]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if (a[-1] == b[0]) and (b[-1] == c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

ls_a = len(a) - 1
ls_b = len(b) - 1

if (a[ls_a] == b[0]) and (b[ls_b] == c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if (a[len(a)-1] == b[0]) and (b[len(b)-1] == c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if (a[len(a) - 1] == b[0]) and (b[len(b) - 1] == c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A , B , C = input().split()

if A == B and B == C:
    print("YES")

else:
    print("NO")

Submission status: Wrong Answer

Solution code:
x, y, z = [i for i in input().split()]
if x[-1] != y[0]:
     print('no')
elif y[-1] != z[0]:
    print('no')
else: 
    print ('yes')

Submission status: Wrong Answer

Solution code:
a = str(input())
print("ABC" + a)

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())

a_last = a[len(a) - 1]
b_last = b[len(b) - 1]

if a_last == b[0] and b_last == c[0] :
    print('YES')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
print('YES' if (a[-1] == b[0]) == (b[-1] == c[0]) else 'NO')

Submission status: Wrong Answer

Solution code:
l = input().split()
if all(l[i][-1] == l[i+1][0] for i in [0,1]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
words = list(input().split())

print(words)

for i in range(len(words)-1):
	if words[i][-1] == words[i+1][0]:
		ans = 'YES'
	else:
		ans = 'NO'
		break
		
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = (i for i in input().split())
print("YES" if a[-1] == b[0] and b[-1] == c[0] else "No")

Submission status: Wrong Answer

Solution code:
A, B, C =input().split()

print('YES' if A[-1]==B[0] and B[-1]==C[0] else 'No')

Submission status: Wrong Answer

Solution code:
#16:05
a,b,c = input().split()
x = int(a[-1]==b[0]) * int(b[-1]==c[0])
if x == 1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a, b, c  = list(input().split())
if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
print(a[-1])
print('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
ans = 'NO'
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
siri = input().split()

one = siri[0][-1:]
two = [siri[1][0:],siri[1][-1:]]
three = siri[2][0:]

if one == two[0]:
  if two[1] == three:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()
print('YES' if A[-1] == B[0] and B[-1] == C[0] and C[-1] == A[0] else 'NO')

Submission status: Wrong Answer

Solution code:
a, b, c = raw_input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print "YES"
else:
    print "No"

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
print("YNeos"[A[-1]!=B[0]or B[-1]!=C[0]::2])

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
Nstr = input().split()
result = 'YES'
for i in range(2):
    print(Nstr[i][-1] , Nstr[i + 1][0])
    if Nstr[i][-1] != Nstr[i + 1][0]:
        result = 'NO'
print(result)

Submission status: Wrong Answer

Solution code:
Nstr = input().split()
result = True
for i in range(2):
    if Nstr[i][-1] != Nstr[i + 1][0]:
        result = False
print(result)

Submission status: Wrong Answer

Solution code:
a,b,c = input().split();print("YNeos"[a[-1]!=b[0] or b[-1]!=c[0]::2])

Submission status: Wrong Answer

Solution code:
#ABC060A
A,B,C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
w=input().split()
if w[0][-1]==w[1][0] and w[1][-1]==w[2][0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B, C = list(input().split())

if A[-1] == B[0] and B[-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
print(["No","Yes"][a[-1]==b[0] and b[-1]==c[0]])

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def shiritori(A: str, B: str, C: str) -> bool:
    return A[-1] == B[0] and B[-1] == C[0]


if __name__ == "__main__":
    A, B, C = input().split()
    yes = shiritori(A, B, C)
    print('Yes' if yes else 'No')

Submission status: Wrong Answer

Solution code:
s=input().split()
print("YES" if s[0][-1]==s[0][0] and s[1][-1]==s[2][0] else 'NO')

Submission status: Wrong Answer

Solution code:
#60
a, b, c = map(str, input().split())
if(a[len(a)-1]==b[0] and b[len(b)-1]==c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def func():
    A, B, C = input().split()
    result = 'Yes' if A[-1] == B[0] and B[-1] == C[0] else 'No'
    return result

print(func())

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
print("YES") if (a[-1] == b[0]) & (b[-1] == a[0]) else print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
if A[-1]==B[0]:
  if B[-1]==C[0]:
    print("YES")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
if A[-0]==B[0]:
  if B[-0]==C[0]:
    print("YES")
  else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print('Yes' if a[-1]==b[0] and b[-1]==c[0] else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[1:]==b[:1] and b[1:]==c[:1]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
import re;print('YNEOS'[len(re.findall('(.) \\1',input()))<2::2])

Submission status: Wrong Answer

Solution code:
s=input().split()
if s[0][-1] == s[1][0] and s[1][-1] == s[2][0]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(str, input().split())
if a[-1] == b[0] and b[-1] == c[0]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[0] == b[-1] and b[0] == c[-1]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
if A[0]==(B[::-1])[0] and B[0]==(C[::-1])[0]:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[0] == b[-1] and b[0] == c[-1]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math

x = input().split()
#y = input().split()
a= []
#for i in range(len(x)):
 #   a.append(int(x[i]))

if x[0][len(x[0])-1] == x[1][0] and x[1][len(x[1])-1] == x[2][0]:print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
A,B,C=input().split()
if A[-1]==B[0] and B[-1]==C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a[-1] == b[-1] and b[-1] == c[-1]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

if a[-1] == b[0]:
    if b[-1] == c[0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
    ans = "YES"
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split(" ")

print("Yes" if a[-1] == b[0] and b[-1] == c[0] else "No")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()
print("Yes" if A[-1] == B[0] and B[-1] == C[0] else "No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
print('Yes' if a[-1] == b[0] and b[-1] == c[0] else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c = map(str,input().split())
print("Yes" if a[-1] == b[0] and b[-1] == c[0] else "No")

Submission status: Wrong Answer

Solution code:
A, B, C = list(input().split())
if A[:1] == B[0] and B[-1] == C[0]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split();print('YNEOS'[a[-1]+c[0]==b[-1]+b[0]::2])

Submission status: Wrong Answer

Solution code:
A,B,C=(i for i in input().split())
if A[-1]==B[0] and B[-1]==C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
print(('No','Yes')[a[-1]==b[0] and b[-1]==c[0]])

Submission status: Wrong Answer

Solution code:
s = list(map(str,input().split()))

a = list(s[0])
b = list(s[1])
c = list(s[2])

if len(a) == 1:
    a.append(a[0])
    
if len(b) == 1:
    b.append(b[0])
if len(c) == 1:
    c.append(c[0])
    


if a[-1] == b[0] and b ==[-1] == c[0]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s = list(map(str,input().split()))

a = list(s[0])
b = list(s[1])
c = list(s[2])

if a[-1] == b[0] and b ==[-1] == c[0]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
s=[a,b,c]
if a[-0]==b[0] and b[-0]==c[0]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[-1::]==b[-1::]==c[-1::]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s = str(input()).split(" ")
if s[0][0] == s[1][-1] and s[1][0] == s[2][-1]:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
nums = input().split()
if nums[0][-1] == nums[1][0] and nums[1][-1] == nums[2][0]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import re
print(("YES","NO")[len(re.split(r"(.) \1",input()))<5])

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()
if A[0] == B[-1] and B[0] == C[0]:
    print ("YES")
else:
    print  ("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()
print('YES' if A[-1] == B[0] and B[-1] == C[0] else 'No')

Submission status: Wrong Answer

Solution code:
def read_str_list():
    return list(str(s) for s in input().split())

a,b,c = read_str_list()
if a[-1]==b[0] and b[-1]==c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def read_str_list():
    return list(str(_) for _ in input().split())

a,b,c = read_str_list()
if a[-1]==b[0] and b[-1]==c[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B,C=[i for i in input().split()]
if A[-1]==B[0]:
    if B[-1]==C[0]:
        print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C=[i for i in input().split()]
if A[-1]==B[0]:
    if B[-1]==C[0]:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C = input().split()

X = False
if A[-1]==B[0]:
    if B[-1] == C[0]:
        X = True

if X:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()


if a[-1] == b[0]:
    if b[-1] == c[0]:
        print("Yes")

    elif b[-1] != c[0]:
        print("No")

elif a[-1] != b[0]:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
 print ('Yes')
else:
 print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(str, input().split())
if a[-1]==b[0] and b[-1]==c[0]:
 print ('Yes')
else:
 print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()

if (a[-1] is b[0]) and (b[-1] is c[0]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b , c= map(str, input().split())

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
     print("Yes")
else:
     print("No")

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, c = map(str, input().split())
    if a[-1] == b[0] and b[-1] == c[0]:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)

if __name__ == '__main__':
   solve()

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, c = map(str, input().split())
    if a[-1] == b[0] and b[-1] == c[0]:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)

if __name__ == '__main__':
   solve()

Submission status: Wrong Answer

Solution code:
a, b, c = list(input().split())
if a[::-1] == b[0] and b[::-1] == c[0]:
    print ("YES\n")
else:
    print("NO\n")

Submission status: Wrong Answer

Solution code:
a, b, c = list(input().split())
if a[::-1] == b[0] and b[::-1] == c[0] and c[::-1] == a[0]:
    print ("YES\n")
else:
    print("NO\n")

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()

ans = 'NO'
if a[len(a)-1] == b[0]:
    if b[len(b)-1 == c[0]]:
        ans = 'YES'

print(ans)

Submission status: Wrong Answer

Solution code:

abc = input().strip().split()

A = abc[0]
B = abc[1]
C = abc[2]

if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
l=input().split(" ")
la=['a','a']
for i in range(2):
    if len(l[i])==1:
        la[i]=l[i]
    else:
        la[i]=l[i][-1]
if la[0]==l[1][0]:
    if la[1]==l[2][0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
l=input().split(" ")
if l[0][-1]==l[1][0]:
    if l[1][-1]==l[2][0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
def is_shiritori(s):
    before_mozi = None
    for mozi in s.split():
        if before_mozi is None:
            before_mozi = mozi
            continue
        else:
            if mozi[0] is not before_mozi[-1]:
                print("No")
                return False
            before_mozi = mozi
    print("OK")

ss = input()
is_shiritori(ss)

Submission status: Wrong Answer

Solution code:

A,B,C = input().split()

if A[-1] == B[0]:
    if B[-1] == C[0]:
        print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = input().split()
def check(a, b, c):
    if a[-1] == b[0] and b[-1] == c[0]:
        return True
    return False
print('Yes' if check(a, b, c) else 'No')

Submission status: Wrong Answer

Solution code:
l = input().split()
def shiritori (letter):
    if letter[0][-1:] == letter[1][:1]:
        if letter[1][-1:] == letter[2][:1]:
            return('YES')
        else:
            return('NO')
    else:
        return('NO')
shiritori(l)

Submission status: Wrong Answer

Solution code:
# A, B, C = input().split()
#
# if A[-1] == B[0] and B[-1] == C[0]:
#     print('YES')
# else:
#     print('NO')

Submission status: Wrong Answer

Solution code:
def is_shiritori(s):
    before_mozi = None
    for mozi in s.split():
        if before_mozi is None:
            before_mozi = mozi
            continue
        else:
            if mozi[0] is not before_mozi[-1]:
                print("No")
                return False
            before_mozi = mozi
    print("OK")

is_shiritori(input())

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] and C[0]:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# 整数の入力
#a = int(raw_input())
# スペース区切りの整数の入力
import numpy as np
import itertools

A, B, C = input().split()
print (A[len(A) - 1] == B[0] and B[len(B)-1] == C[0])

Submission status: Wrong Answer

Solution code:

A,B,C = input().split()

if A[-1] == B[0]:
    if B[-1] == C[0]:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


A,B,C = map(str,raw_input().split(" "))

if(A[-1]==B[0]):
	if(B[-1]==C[0]):
		print "YES"

else:
	print "NO"

Submission status: Wrong Answer

Solution code:
A, B, C = input().split()

if A[-1] == B[0] and B[-1] and C[-1]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
def iroha():
    a, b, c = input().split()
    
    s = a[len(a)-1]
    sshead = b[0]
    sstail = b[len(b)-1]
    sss = c[0]

    if s == sshead and sstail == sss:
        print("YES")
    else:
        print("NO")





if __name__ == "__main__":
    iroha()

Submission status: Accepted

Solution code:
a,b,c = input().split()
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = input().split()
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")