begin s = readline().chomp for i in 0..(s.length-1) do for j in (i+2)..(s.length) do inlist = Array.new(26, 0) outlist = Array.new(26, 0) flg = true for k in 0..(s.length-1) do c = s[k].codepoints[0] - 97 if k < i || k >= j || (k - i) % 2 == 1 if s[k] != ' ' outlist[c] = outlist[c] + 1 end else if s[k] == ' ' flg = false else inlist[c] = inlist[c] + 1 end end end for k in 0..25 do if inlist[k] > 0 && outlist[k] > 0 flg = false end end if flg puts 'Yes' exit() end end end rescue end puts 'NO'