local n = io.read("*n")
io.read()

local function test(n)
    local test1 = {}
    local useOK = "YES"
    local protect = true
    for i=1,n do
        local s = io.read("*l")
        table.insert(test1,s)
        if i > 1 then
            local before = test1[i-1]
            if string.sub(before,-1,-1) ~= string.sub(s,1,1) then
                if protect then
                    useOK =  "NO"
                    protect = false
                end

            end
        end
    end
    return useOK
end
print(test(n))