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-----
rng gorilla apple

-----Sample Output-----
YES

They form a word chain.
[{"code": "s1,s2,s3 = input().split()\nprint(\"YES\") if s1[-1]==s2[0] and s2[-1]==s3[0] else print(\"NO\")", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a,b,c = input().split()\n\nif a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:\n  print('YES')\nelse:\n  print('NO')", "passed": true, "time": 0.25, "memory": 14220.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n  print('YES')\nelse:\n  print('NO') ", "passed": true, "time": 0.23, "memory": 14140.0, "status": "done"}, {"code": "def iroha():\n    a, b, c = input().split()\n    \n    s = a[len(a)-1]\n    sshead = b[0]\n    sstail = b[len(b)-1]\n    sss = c[0]\n\n    if s == sshead and sstail == sss:\n        print(\"YES\")\n    else:\n        print(\"NO\")\n\n\n\n\n\ndef __starting_point():\n    iroha()\n\n\n__starting_point()", "passed": true, "time": 0.22, "memory": 14180.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\nif A[-1] == B[0] and B[-1] == C[0]:\n    result = 'YES'\nelse:\n    result = 'NO'\nprint(result)", "passed": true, "time": 0.24, "memory": 14188.0, "status": "done"}, {"code": "# A - Shiritori\n\n\ndef f(x):\n    f_list = []\n    for i in x:\n        f_list.append(i)\n    return f_list\n\n\n# \u6a19\u6e96\u5165\u529b a b c\na, b, c = list(map(str, input().split(maxsplit=3)))\n\nword_list_a = f(a)\nword_list_b = f(b)\nword_list_c = f(c)\n\nif word_list_a.pop() == word_list_b[0] and word_list_b.pop() == word_list_c[0]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.26, "memory": 14284.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "a,b,c=map(str,input().split())\nif a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.16, "memory": 14196.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nprint(\"YES\" if A[-1] == B[0] and B[-1] == C[0] else \"NO\")", "passed": true, "time": 0.16, "memory": 14068.0, "status": "done"}, {"code": "'''\nabc060 A - Shiritori\nhttps://atcoder.jp/contests/abc060/tasks/abc060_a\n'''\n\ns = list(input().split())\nif s[0][-1] == s[1][0] and s[1][-1] == s[2][0]:\n    ans = 'YES'\nelse:\n    ans = 'NO'\nprint(ans)\n", "passed": true, "time": 0.16, "memory": 14056.0, "status": "done"}, {"code": "a,b,c = map(str,input().split())\nif a[-1] == b[0] and b[-1] == c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.25, "memory": 14100.0, "status": "done"}, {"code": "A,B,C = input().split()\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "a, b, c = input().split()\n\nA = list(a)\nB = list(b)\nC = list(c)\n\nif A[len(A) -1 ] == B[0] and B[len(B)-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.16, "memory": 14152.0, "status": "done"}, {"code": "A,B,C = map(str,input().split())\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.36, "memory": 14016.0, "status": "done"}, {"code": "A,B,C = input().split()\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.26, "memory": 14144.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.29, "memory": 14116.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a [-1] == b[0] and b[-1] == c [0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "s=input().split()\nprint(\"YES\" if all(s[i][-1]==s[i+1][0] for i in range(len(s)-1)) else \"NO\")", "passed": true, "time": 0.3, "memory": 14272.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "'''\n\u554f\u984c\uff1a\n    \u6587\u5b57\u5217 A, B, C\u304c\u4e0e\u3048\u3089\u308c\u307e\u3059\u3002\n    \u3053\u308c\u304c\u3057\u308a\u3068\u308a\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n    \u3064\u307e\u308a\u3001\n        A \u306e\u6700\u5f8c\u306e\u6587\u5b57\u3068 B \u306e\u6700\u521d\u306e\u6587\u5b57\u304c\u540c\u3058\n        B \u306e\u6700\u5f8c\u306e\u6587\u5b57\u3068 C \u306e\u6700\u521d\u306e\u6587\u5b57\u304c\u540c\u3058\n    \u3053\u306e 2\u3064\u304c\u6b63\u3057\u3044\u304b\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n    \u4e21\u65b9\u3068\u3082\u6b63\u3057\u3044\u306a\u3089\u3070 YES\u3001\u305d\u3046\u3067\u306a\u3044\u306a\u3089\u3070 NO \u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n'''\n\n'''\n\u5236\u7d04\uff1a\n    A, B, C \u306f\u5168\u3066\u82f1\u5c0f\u6587\u5b57(a ~ z)\u304b\u3089\u306a\u308b\u3002\n    1 \u2266 |A|, |B|, |C| \u2266 10\n    \u306a\u304a\u3001\n    |A|, |B|, |C| \u306f\u6587\u5b57\u5217A, B, C\u306e\u9577\u3055\u3092\u8868\u3057\u307e\u3059\u3002\n'''\n\n# \u6a19\u6e96\u5165\u529b\u304b\u3089 A, B, C \u3092\u53d6\u5f97\u3059\u308b\na, b, c = list(map(str, input().split()))\n\nresult = 'ret'\n\nif ( a[-1] == b[0] ) and (b[-1] == c[0]) :\n    result = 'YES'\nelse:\n    result = 'NO'\n\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "# A - Shiritori\n# https://atcoder.jp/contests/abc060/tasks/abc060_a\n\na, b, c = list(map(str, input().split()))\n\nif a[-1] == b[0] and b[-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.35, "memory": 14160.0, "status": "done"}, {"code": "A, B, C = list(map(str,input().split()))\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:print('YES')\nelse:print('NO')", "passed": true, "time": 0.21, "memory": 14164.0, "status": "done"}, {"code": "a,b,c=map(str,input().split())\n\nif a[len(a)-1]==b[0] and b[len(b)-1]==c[0]:\n    ans=\"YES\"\nelse:\n    ans=\"NO\"\nprint(ans)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "A,B,C = list(map(str,input().split()))\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    result = \"YES\"\nelse:\n    result = \"NO\"\n\nprint(result)\n", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nprint(\"YES\" if A[-1] == B[0] and B[-1] == C[0] else \"NO\")", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "A, B, C = input().split()\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "A, B, C = map(str, list(input().split())) # \u6587\u5b57\u5217\u3092\u4e00\u6587\u5b57\u305a\u3064\u306e\u30ea\u30b9\u30c8\u5316\u3057\u8907\u6570\u306e\u30ea\u30b9\u30c8\u306b\u5165\u308c\u308b\n\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a,b,c = input().split()\nprint(\"YES\" if a[-1]==b[0] and b[-1]==c[0] else \"NO\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "\ndef resolve():\n    a, b, c = input().split()\n    print(('YES' if a[-1] == b[0] and b[-1] == c[0] else 'NO'))\n\ndef __starting_point():\n    resolve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "s = [x for x in input().split()]\nif s[0][-1] == s[1][0] and s[1][-1] == s[2][0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "A, B, C = list(input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.21, "memory": 14076.0, "status": "done"}, {"code": "a,b,c = input().split()\n\nif a[-1] == b[0] and b[-1] == c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "\nA,B,C = map(str,input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\n\nelse:\n    print('NO')", "passed": true, "time": 0.48, "memory": 14256.0, "status": "done"}, {"code": "A,B,C = input().split()\nprint(['NO','YES'][A[-1:]==B[0] and B[-1:]==C[0]])", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "a, b, c = map(str, input().split())\nif a[-1] == b[0] and b[-1] == c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nA, B, C = lstr()\nprint('YES' if A[-1] == B[0] and B[-1] == C[0] else 'NO')", "passed": true, "time": 0.32, "memory": 14256.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.31, "memory": 14272.0, "status": "done"}, {"code": "#60\nA,B,C=input().split()\nif A[-1]==B[0] and B[-1]==C[0]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.57, "memory": 14060.0, "status": "done"}, {"code": "a, b, c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n", "passed": true, "time": 0.3, "memory": 14060.0, "status": "done"}, {"code": "A,B,C=map(str,input().split())\nif A[-1]==B[0] and B[-1]==C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "a, b, c = input().split()\nprint(('YES', 'NO')[a[-1] + c[0] != b[0] + b[-1]])", "passed": true, "time": 0.22, "memory": 14184.0, "status": "done"}, {"code": "a, b, c = input().split()\nprint(\"YES\" if a[-1] == b[0] and b[-1] == c[0] else \"NO\")", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "a, b, c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n  print('YES')\nelse:\n  print('NO')", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\n\nA_num = len(A)\nB_num = len(B)\nif A[A_num - 1] == B[0] and B[B_num - 1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.16, "memory": 14216.0, "status": "done"}, {"code": "a, b, c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "a, b, c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "A,B,C = map(str, input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "A, B, C=input().split(\" \")\n\nif A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:\n  print('YES')\nelse:\n  print('NO')", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "A, B, C = map(str, input(). split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "a,b,c=input().split()\nprint(\"YES\" if a[-1]==b[0]and b[-1]==c[0] else \"NO\")", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a, b, c = input().split()\n\nif a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "a, b, c = input().split()\nlen_a = len(a)\nlen_b = len(b)\n\nif(a[len_a-1] == b[0] and b[len_b-1] == c[0]):\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "a, b, c = input().split()\nprint('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "A,B,C = input().split()\nprint(\"YES\" if A[-1] == B[0] and B[-1] == C[0] else \"NO\")", "passed": true, "time": 0.15, "memory": 14108.0, "status": "done"}, {"code": "A, B, C = map(str, input(). split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print( \"YES\" )\nelse:\n    print( \"NO\" )", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "A, B, C = input().split()\n\ndef answer(A: int, B: int, C: int) -> str:\n    if A[-1] == B[0] and B[-1] == C[0]:\n        return 'YES'\n    else:\n        return 'NO'\n\nprint((answer(A, B, C)))\n", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "a,b,c=map(str,input().split())\n\nprint('YES' if a[-1] == b[0] and b[-1] == c[0] else 'NO')", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a, b, c = map(str, input().split())\nif a[-1] == b[0] and b[-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "a, b, c = input().split()\n\nif (a[-1] == b[0]) and (b[-1] == c[0]):\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "s = (input().split())\nt = len(s)\ncnt = 0\nfor i in range(t):\n    if i != t - 1:\n        if (s[i][-1]) == s[i + 1][0]:\n            cnt += 1\n    else:\n        break\n\nif cnt == t - 1:print(\"YES\")\nelse:print(\"NO\")", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "A, B, C = input().split()\nif A[len(A)-1:len(A)] == B[0:1] and B[len(B)-1:len(B)] == C[0:1]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "a,b,c = input().split()\n# \u3057\u308a\u3068\u308a\u304c\u6210\u308a\u7acb\u3063\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\nif a[-1] == b[0] and b[-1] == c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "# 060_a\nA, B, C = input().split()\n\nif (1<=len(A) and len(A)<=10 and A.islower()) and (1<=len(B) and len(B)<=10 and B.islower())\\\n        and (1<=len(C) and len(C)<=10 and C.islower()):\n    if (A[len(A) - 1] == B[0]) and (B[len(B) - 1] == C[0]):\n        print('YES')\n    else:\n        print('NO')\n", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "A,B,C = list(map(str,input().split()))\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')\n\n", "passed": true, "time": 0.15, "memory": 14320.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\n\n# \u6587\u5b57\u5217 A,B,C\u304c\u4e0e\u3048\u3089\u308c\u307e\u3059\u3002\u3053\u308c\u304c\u3057\u308a\u3068\u308a\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u5224\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n# \u6b63\u3057\u3044\u306a\u3089\u3070 YES\u3001\u305d\u3046\u3067\u306a\u3044\u306a\u3089\u3070 NO \u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "# \u6570\u5024\u3092\u53d6\u5f97\nword_list = input().split()\nw_cnt = len(word_list)\n\n# \u8a9e\u982d\u8a9e\u5c3e\u306e\u62bd\u51fa\ns_list = []\ne_list = []\nfor cnt in range(0,w_cnt,1):\n    s_list.append(word_list[cnt][0])\n    e_list.append(word_list[cnt][-1])\n\n# \u6210\u7acb\u3057\u3066\u308b\u304b\u691c\u67fb\u5f8c\u7d50\u679c\u3092\u51fa\u529b\njudge = \"YES\"\nfor cnt in range(1,w_cnt,1):\n    if s_list[cnt] != e_list[cnt-1]:\n        judge = \"NO\"\nprint(judge)", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "a,b,c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "a, b, c = map(str, input().split())\n\nif a[-1] == b[0] and b[-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "def atc_060a(input_value: str) -> str:\n    A, B, C = list(map(str, input_value.split(\" \")))\n    if A[-1] == B[0] and B[-1] == C[0]:\n        return \"YES\"\n    else:\n        return \"NO\"\n\ninput_value = input()\nprint((atc_060a(input_value)))\n", "passed": true, "time": 0.24, "memory": 14032.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[len(a) -1] == b[0] and b[len(b) -1] == c[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "a, b, c=input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n  print('YES')\nelse:\n  print('NO')", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "a, b, c = input().split()\n\nif a[-1]==b[0] and b[-1]==c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n", "passed": true, "time": 0.15, "memory": 14260.0, "status": "done"}, {"code": "A,B,C=input().split()\nif A[-1]==B[0] and B[-1]==C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n", "passed": true, "time": 0.24, "memory": 14204.0, "status": "done"}, {"code": "def atc_060a(input_value: str) -> str:\n    A, B, C = map(str, input_value.split(\" \"))\n    if A[-1] == B[0] and B[-1] == C[0]:\n        return \"YES\"\n    else:\n        return \"NO\"\n\ninput_value = input()\nprint(atc_060a(input_value))", "passed": true, "time": 0.14, "memory": 14012.0, "status": "done"}, {"code": "a, b, c = list(map(str, input().split()))\nif a[-1] == b[0] and b[-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[-1]==b[0] and b[-1]==c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n  print(\"YES\")\nelse:\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.23, "memory": 14172.0, "status": "done"}, {"code": "# A \u306e\u672b\u3068B \u306e\u982d\u6587\u5b57\u3001B \u306e\u672b\u3068C \u306e\u982d\u6587\u5b57\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\n\nA, B, C = list(map(str, input().split()))\n\ninitial_1 = A[-1]\nend_1 = B[0]\ninitial_2 = B[-1]\nend_2 = C[0]\n\nif initial_1 == end_1 and initial_2 == end_2:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "A, B, C = map(str,input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "A, B, C = list(map(str, input().split()))\nif A[-1] == B[0] and B[-1] == C[0]:\n    print('YES')\nelse:\n    print('NO')", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "#ABC060A\na,b,c = input().split()\nprint(\"YES\" if (a[-1] == b[0]) and (b[-1] == c[0]) else \"NO\")", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "#\u7b54\u3048\u306f\u3042\u3063\u3066\u308b\u3051\u3069WA\nA, B, C = input().split()\n\nif A[-1]==B[0] and B[-1]==C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "A,B,C=map(str,input().split())\nif A[-1]==B[0] and B[-1]==C[0] :\n  print(\"YES\")\nelse :\n  print(\"NO\")", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "A,B,C=list(map(str,input().split()))\n\nif A[-1]==B[0] and B[-1]==C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "A, B, C = input().split()\nprint('YES' if B.startswith(A[-1]) and C.startswith(B[-1]) else 'NO')", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "A, B, C = map(str, input().split())\n\nif A[-1] == B[0] and B[-1] == C[0]:\n    print(\"YES\")\nelse:\n    print(\"NO\")", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "a,b,c = input().split()\nprint(\"YES\" if a[-1] == b[0] and b[-1] == c[0] else \"NO\")", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "S = input().split()\nprint('YES' if S[0][-1] == S[1][0] and S[1][-1] == S[2][0] else 'NO')", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "a, b, c = list(map(str, input().split()))\n\nif a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:\n    print('YES')\nelse:\n    print('NO')\n\n\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "a=input().split(\" \")\nprint(\"YES\") if a[0][-1]==a[1][0] and a[1][-1]==a[2][0] else print(\"NO\")", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "a,b,c = input().split()\nif a[-1] == b[0] and b[-1] == c[0]:\n  print('YES')\nelse :\n  print('NO')", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}]