output_description: Print `YES` or `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: a,b,c=map(input().split())
  if("YES" if a[len(a)-1]==b[0] and b[len(b)-1]==c[0] else "NO")
  
problem_description: 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`.
samples: [{"input": "rng gorilla apple", "output": "YES\n    \n\nThey form a word chain.\n\n* * *"}, {"input": "yakiniku unagi sushi", "output": "NO\n    \n\nA and B form a word chain, but B and C do not.\n\n* * *"}, {"input": "a a a", "output": "YES\n    \n\n* * *"}, {"input": "aaaaaaaaab aaaaaaaaaa aaaaaaaaab", "output": "NO"}]