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: Accepted

Solution code:
s = (input().split())
t = len(s)
cnt = 0
for i in range(t):
    if i != t - 1:
        if (s[i][-1]) == s[i + 1][0]:
            cnt += 1
    else:
        break

if cnt == t - 1:print("YES")
else:print("NO")

Submission status: Accepted

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: Accepted

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

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 = map(str,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[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")

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:
s1,s2,s3 = input().split()
print("YES") if s1[-1]==s2[0] and s2[-1]==s3[0] 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 atc_060a(input_value: str) -> str:
    A, B, C = map(str, input_value.split(" "))
    if A[-1] == B[0] and B[-1] == C[0]:
        return "YES"
    else:
        return "NO"

input_value = input()
print(atc_060a(input_value))

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

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: 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=map(str,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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: Accepted

Solution code:
# 060_a
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 (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")

Submission status: Accepted

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

def answer(A: int, B: int, C: int) -> str:
    if A[-1] == B[0] and B[-1] == C[0]:
        return 'YES'
    else:
        return 'NO'

print(answer(A, B, C))

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

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: 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:
a=input().split(" ")
print("YES") if a[0][-1]==a[1][0] and a[1][-1]==a[2][0] else print("NO")

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b, c = s_map()

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

if __name__ == '__main__':
    main()

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:
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()
print('YNEOS'[a[-1]!=b[0] or b[-1]!=c[0]::2])

Submission status: Accepted

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: 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:
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()
print(('YES', 'NO')[a[-1] + c[0] != b[0] + b[-1]])

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()
print("YES" if a[-1]==b[0]and b[-1]==c[0] else "NO")

Submission status: Accepted

Solution code:
# A - Shiritori
# https://atcoder.jp/contests/abc060/tasks/abc060_a

a, b, c = map(str, 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()

A = list(a)
B = list(b)
C = list(c)

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[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 = map(str, input().split())

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

Submission status: Accepted

Solution code:
# A - Shiritori
def main():
    a, b, c = input().split()

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


if __name__ ==  "__main__":
    main()

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が与えられます。
    これがしりとりになっているか判定してください。

    つまり、
        A の最後の文字と B の最初の文字が同じ
        B の最後の文字と C の最初の文字が同じ
    この 2つが正しいか判定してください。
    両方とも正しいならば YES、そうでないならば NO を出力してください。
'''

'''
制約：
    A, B, C は全て英小文字(a ~ z)からなる。
    1 ≦ |A|, |B|, |C| ≦ 10
    なお、
    |A|, |B|, |C| は文字列A, B, Cの長さを表します。
'''

# 標準入力から A, B, C を取得する
a, b, c = map(str, input().split())

result = 'ret'

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

print(result)

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[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def atc_060a(input_value: str) -> str:
    A, B, C = map(str, input_value.split(" "))
    if A[-1] == B[0] and B[-1] == C[0]:
        return "YES"
    else:
        return "NO"

input_value = input()
print(atc_060a(input_value))

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

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

if A[-1] == B[0] and B[-1] == C[0]:
    result = "YES"
else:
    result = "NO"

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A - Shiritori


def f(x):
    f_list = []
    for i in x:
        f_list.append(i)
    return f_list


# 標準入力 a b c
a, b, c = map(str, input().split(maxsplit=3))

word_list_a = f(a)
word_list_b = f(b)
word_list_c = f(c)

if word_list_a.pop() == word_list_b[0] and word_list_b.pop() == word_list_c[0]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
# A の末とB の頭文字、B の末とC の頭文字が一致しているか

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

initial_1 = A[-1]
end_1 = B[0]
initial_2 = B[-1]
end_2 = C[0]

if initial_1 == end_1 and initial_2 == end_2:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = open(0).read().split()
print('YES' if (A[len(A)-1] == B[0]) and (B[len(B)-1] == C[0]) else '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:
#60
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 = map(str, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
    result = 'YES'
else:
    result = 'NO'
print(result)

Submission status: Accepted

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: Accepted

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: Accepted

Solution code:
# 数値を取得
word_list = input().split()
w_cnt = len(word_list)

# 語頭語尾の抽出
s_list = []
e_list = []
for cnt in range(0,w_cnt,1):
    s_list.append(word_list[cnt][0])
    e_list.append(word_list[cnt][-1])

# 成立してるか検査後結果を出力
judge = "YES"
for cnt in range(1,w_cnt,1):
    if s_list[cnt] != e_list[cnt-1]:
        judge = "NO"
print(judge)

Submission status: Accepted

Solution code:

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

# 文字列 A,B,Cが与えられます。これがしりとりになっているか判定してください。
# 正しいならば YES、そうでないならば NO を出力してください。

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

Submission status: Accepted

Solution code:
A, B, C = map(str, list(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 = map(str, input(). split())

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B, C = input().split()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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: 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()
print("YES" if a[-1] == b[0] and b[-1] == c[0] else "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:
S_1, S_2, S_3 = map(str,input().split())
if S_1[-1] == S_2[0] and S_2[-1] == S_3[0] :
    result = "YES"
else :
    result = "NO"
print(result)

Submission status: Accepted

Solution code:
num_a, num_b, num_c = map(str, input().split())

if num_a[-1] == num_b[0] and num_b[-1] == num_c[0]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = input().split()
print('YES') if a[-1] == b[0] and b[-1] == c[0] 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()
print("YES" if a[-1]==b[0] and b[-1]==c[0] else "NO")

Submission status: Accepted

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: 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:
#
# abc060 a
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """rng gorilla apple"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """yakiniku unagi sushi"""
        output = """NO"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """a a a"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """aaaaaaaaab aaaaaaaaaa aaaaaaaaab"""
        output = """NO"""
        self.assertIO(input, output)


def resolve():
    A, B, C = input().split()

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

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=map(str,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()
print("YES" if A[-1]==B[0] and B[-1]==C[0] else "NO")

Submission status: Accepted

Solution code:
a, b, c = (s for s in 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 = map(str, 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=map(str,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 = map(str, 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 = map(str, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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: 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();print('NYOE S'[a[-1]==b[0] and b[-1]==c[0]::2])

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

Solution code:
l=input().split()
if(l[0][-1]==l[1][0] and l[1][-1]==l[2][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:
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:
def solve():
    A, B, C = input().split()
    if A[-1] == B[0] and B[-1] == C[0]:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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:
#!/usr/bin/env python3
A, B, C = map(str, 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:
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 = map(str, 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[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[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()

d = len(a)-1
e = len(b)-1

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b,c = map(str,input().split())
isOK = False
if a[-1]==b[0] and b[-1]==c[0]:
    isOK = True

if isOK:
    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:
a, b, c = input().split()
f = lambda x, y, z : x[-1] == y[0] and y[-1] == z[0]
print("YES" if f(a, b, c) else "NO")

Submission status: Accepted

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: Accepted

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: 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:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(str, readline().decode('utf-8').strip().split())
    if A[-1]==B[0] and B[-1]==C[0]:
        print('YES')
    else:
        print('NO')



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


a,b,c = map(str, 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 = map(str,input().split())
print('YES' if A[-1] == B[0] and B[-1] == C[0] else 'NO')

Submission status: Accepted

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

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]:
  ans = 'YES'
else:
  ans = 'NO'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
X, Y, Z = input().split()
if X[-1]==Y[0] and Y[-1]==Z[0]:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
#coding: utf-8
import sys
data = list(i for i in input().split())

for i in range(len(data)-1):
    if (data[i][-1] == data[i + 1][0]):
        continue
    else:
        print("NO")
        sys.exit()
else:
    print("YES")

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:
li=input().split()
a=li[0]
b=li[1]
c=li[2]
if a[-1:-2:-1]==b[0:1] and b[-1:-2:-1]==c[0: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()
print(['NO','YES'][A[-1]==B[0] and B[-1]==C[0]])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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()
n = 0
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
tmp = input().split(" ")
a_end = tmp[0][-1:]
b_start = tmp[1][:1]
b_end = tmp[1][-1:]
c_start = tmp[2][:1]

print("YES") if (a_end == b_start and b_end == c_start) 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 = list(map(str,input().split()))
flag = 0

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

Submission status: Accepted

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

Submission status: Accepted

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: 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[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[(len(a) - 1)] == b[0] and b[(len(b)) - 1] == c[0]:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C = readline().split()

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input().split()
print('YES' if s[0][-1]==s[1][0] and s[1][-1]==s[2][0] else '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:
A, B, C = input().split()
print("YES" if A[-1] == B[0] and B[-1] == C[0] else "NO")

Submission status: Accepted

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: Accepted

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