local n = io.read()
local wordTb = {}
local hashValTb = {}
local maxSize = n

local function getHashVal(str)
	local hash = 0
	for i=1, string.len(str) do
		local charN = string.byte(str,i)
		hash = 33*hash + charN
	end
	return hash % (maxSize+2)
end

local function checkWord(recordTb, word)
	local val = getHashVal(word)
	if hashValTb[val] then return false end
	hashValTb[val] = true
	local lastWord = recordTb[#recordTb]
	return string.byte(lastWord,#lastWord) == string.byte(word,1)
end

for i=1, n do
	local input = io.read("*n")
	local p = string.find(input, "/n")
	local word = string.sub(input, p)
	wordTb[i] = word
	local ret = checkWord(wordTb, word)
	if not ret then
		return "NO"
	end
end
return "YES"
--#17025101 | rumexx's solution for [AtCoder-4252] [Problem B]