local n = io.read("*n")
local tag = true
local lastC = nil
io.read()
for i = 1, n do
	local new = io.read("*line")
	if i ~= 1 then
		local newC = string.sub(new,1,1)
		if string.find(newC, lastC) ~= 1 then
			tag = false
		end
	end
	lastC = string.sub(new, -1, -1)
end

if tag then 
	print("YES")
else
	print("NO")
end