Kostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That's why he decided to obfuscate (intentionally make less readable) his code before upcoming contest.

To obfuscate the code, Kostya first looks at the first variable name used in his program and replaces all its occurrences with a single symbol a, then he looks at the second variable name that has not been replaced yet, and replaces all its occurrences with b, and so on. Kostya is well-mannered, so he doesn't use any one-letter names before obfuscation. Moreover, there are at most 26 unique identifiers in his programs.

You are given a list of identifiers of some program with removed spaces and line breaks. Check if this program can be a result of Kostya's obfuscation.


-----Input-----

In the only line of input there is a string S of lowercase English letters (1 ≤ |S| ≤ 500) — the identifiers of a program with removed whitespace characters.


-----Output-----

If this program can be a result of Kostya's obfuscation, print "YES" (without quotes), otherwise print "NO".


-----Examples-----
Input
abacaba

Output
YES

Input
jinotega

Output
NO



-----Note-----

In the first sample case, one possible list of identifiers would be "number string number character number string number". Here how Kostya would obfuscate the program:



 replace all occurences of number with a, the result would be "a string a character a string a",

 replace all occurences of string with b, the result would be "a b a character a b a",

 replace all occurences of character with c, the result would be "a b a c a b a",

 all identifiers have been replaced, thus the obfuscation is finished.

Difficulty: EASY
Tags: String algorithms

Implementation

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
x = [i for i in s]
y = []
for i in x:
	if i in y:
		continue
	else:
		y.append(i)
l = len(y)
j = ''.join(y)
if a[:l] == j:
	print('YES')
else:
	print('NO')


st = ''

def inp():
	global st
	st = input()

def solve():
	global st
	cp = 'a'
	if st[0] != 'a':
		return 'NO'
	while True:
		st = st.replace(cp, '')
		if st == '':
			return 'YES'
		if ord(st[0]) != ord(cp) + 1:
			return 'NO'
		cp = st[0]
inp()
rs = solve()
print(rs)


s = input()
v = [0] * 26
for i in s:
	if i == 'a' or v[ord(i) - 97 - 1] == 1:
		v[ord(i) - 97] = 1
		pass
	else:
		print('NO')
		exit()
print('YES')


s = input()
dic = {}
for i in s:
	if i in dic:
		dic[i] = dic[i] + 1
	else:
		dic[i] = 1
l = list(dic.keys())
n = len(l)
c = 97
res = []
for i in range(0, 26):
	res.append(chr(c))
	c = c + 1
x = res[0:n]
if l == x:
	print('YES')
else:
	print('NO')


s = input()
f = 'YES'
r = 97
for c in s:
	if ord(c) > r:
		f = 'NO'
		break
	if ord(c) == r:
		r += 1
print(f)


try:
	s = input()
	s1 = set(s)
	l = list(s)
	l2 = []
	for i in range(len(l)):
		if l[i] in s1:
			l2.append(l[i])
			s1.remove(l[i])
	k = ''.join(l2)
	m = ''.join(sorted(l2))
	c = 0
	haha = ord('a')
	for i in range(len(k)):
		if ord(k[i]) == haha:
			c += 1
			haha += 1
	if c == len(k):
		print('YES')
	else:
		print('NO')
except EOFError:
	pass


string = input()
letters = 'abcdefghijklmnopqrstuvwxyz'
for letter in letters:
	string = string.replace(letter, '.', 1).replace(letter, '').replace('.', letter)
print(['NO', 'YES'][letters.find(string) == 0])


s = input()
if s[0] != 'a':
	print('NO')
	exit()
l = [True]
for _ in range(25):
	l.append(False)
for i in range(1, len(s)):
	l[ord(s[i]) - ord('a')] = True
	if s[i] != 'a' and l[ord(s[i]) - ord('a') - 1] == False:
		print('NO')
		exit()
print('YES')


s = input()
freq = [0 for i in range(26)]
max1 = s[0]
inv = 1
for i in s:
	freq[ord(i) - ord('a')] += 1
	if i <= max1 or ord(i) == ord(max1) + 1:
		max1 = max(max1, i)
	else:
		inv = -1
if s[0] != 'a':
	inv = -1
if inv == -1:
	print('NO')
else:
	print('YES')


str = input()
next = 'a'
for c in str:
	if c < next:
		continue
	elif c == next:
		next = chr(ord(next) + 1)
	else:
		print('NO')
		exit()
print('YES')


s = input()
a = [0] * 26
ind = 0
for i in s:
	yy = ord(i) - 97
	if a[yy] == 0 and yy != ind:
		print('NO')
		exit()
	else:
		ind += a[yy] == 0
		a[yy] = 1
print('YES')


s = list(input())
n = len(s)
flag = True
last = ord(s[0])
if last != ord('a'):
	flag = False
else:
	for i in range(1, n):
		cur = ord(s[i])
		if cur - last > 1:
			flag = False
			break
		last = max(last, cur)
if flag == True:
	print('YES')
else:
	print('NO')


s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
c = 0
p = True
if s[0] == 'a':
	for t in s:
		if ord(t) - ord(a[c]) == 1:
			c += 1
		elif ord(t) - ord(a[c]) > 1:
			p = False
			break
else:
	p = False
if p:
	print('YES')
else:
	print('NO')


import sys

def debug(x, table):
	for (name, val) in table.items():
		if x is val:
			print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
			return None

def solve():
	S = input()
	ch = ord('a')
	for c in S:
		if ord(c) > ch:
			print('NO')
			return
		elif ord(c) == ch:
			ch += 1
		else:
			pass
	print('YES')
solve()


def solve(s):
	fr = 200 * [0]
	ok = True
	for i in range(len(s)):
		if s[i] != 'a':
			o = ord(s[i])
			if fr[o - 1] == 0:
				ok = False
				break
			else:
				fr[o] = 1
		else:
			fr[ord('a')] = 1
	if ok == True:
		print('YES')
	else:
		print('NO')

def read():
	s = input()
	solve(s)
read()


s = input()

def main(s):
	obphLetters = []
	usedLetters = 'abcdefghijklmnopqrstuvwxyz'
	maxLetterIndex = 0
	for letter in s:
		nowIndex = usedLetters.index(letter)
		if nowIndex == maxLetterIndex and letter not in obphLetters:
			obphLetters.append(letter)
			maxLetterIndex += 1
		elif nowIndex > maxLetterIndex:
			return 'NO'
	return 'YES'
print(main(s))


s = input()
pos = ord('a') - 1
for i in s:
	if ord(i) - pos == 1:
		pos += 1
	elif ord(i) - pos > 1:
		print('NO')
		exit()
print('YES')


A = 'abcdefghijklmnopqrstuvwxyz'
s = input()
was = set()
s2 = ''
for c in s:
	if c not in was:
		s2 += c
		was.add(c)
print('YES' if A.startswith(s2) else 'NO')


s = input().strip()
table = [-1] * 26
count = 0
for (i, c) in enumerate(s):
	index = ord(c) - ord('a')
	if table[index] == -1:
		table[index] = i
		count += 1
for i in range(count):
	if table[i] == -1 or (i > 0 and table[i - 1] > table[i]):
		print('NO')
		break
else:
	print('YES')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	string = input()
	sorted_string = sorted(set(string), key=string.index)
	for i in range(0, len(sorted_string)):
		if sorted_string[i] == chr(97 + i):
			continue
		else:
			exit(print('NO'))
	print('YES')
main()


alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
s = input()
numbers = [alphabet.index(x) for x in s]
a = max(numbers)
for x in range(a):
	if not x in numbers:
		print('NO')
		break
else:
	b = 0
	for x in numbers:
		if x > b:
			print('NO')
			break
		if x == b:
			b += 1
	else:
		print('YES')


from sys import exit
s = input()
cur = ord('a')
for i in range(len(s)):
	if ord(s[i]) == cur:
		cur = cur + 1
	elif ord(s[i]) > cur:
		print('NO')
		exit(0)
print('YES')


a = input()
data = 'abcdefghijklmnopqrstuvwxyz'
data = list(data)
ans = 0
if a[0] != data[0]:
	print('NO')
else:
	for i in a:
		if i not in data:
			ans = 1
		elif i == data[0]:
			ans = 1
			data.remove(data[0])
		else:
			ans = 0
			break
	if ans == 1:
		print('YES')
	else:
		print('NO')


import sys
next_allowed = 'a'
s = input()
for c in s:
	if ord(c) > ord(next_allowed):
		print('NO')
		return
	elif ord(c) == ord(next_allowed):
		next_allowed = chr(ord(next_allowed) + 1)
print('YES')


s = ''.join({}.fromkeys(input()).keys())
a = 'abcdefghijklmnopqrstuvwxyz'
if a[:len(s)] == s:
	print('YES')
else:
	print('NO')


line = input()
expected = ord('a') - 1
for i in line:
	if ord(i) > expected:
		if ord(i) == expected + 1:
			expected += 1
		else:
			exit(print('NO'))
print('Yes')


A = input()
o = 97
while len(A) != 0 and A[0] == chr(o):
	while A.find(chr(o)) != -1:
		x = A.find(chr(o))
		if x != len(A) - 1:
			A = A[:x] + A[x + 1:]
		else:
			A = A[:-1]
	o += 1
if len(A) == 0:
	print('YES')
else:
	print('NO')


import string
s = list(input())
arr = []
for i in string.ascii_lowercase:
	try:
		arr.append(s.index(i))
	except:
		arr.append(500)
f = True
for i in range(1, len(arr)):
	if arr[i] < arr[i - 1]:
		f = False
		break
print('YES' if f else 'NO')


s = input()
x = sorted(set(s), key=s.index)
for i in range(len(x)):
	if x[i] != chr(ord('a') + i):
		exit(print('NO'))
print('YES')


a = input()
b = 'a'
a = list(a)
i = 0
flag = 0
while i < len(a):
	if a[i] == b:
		p = a[i]
		j = 0
		while j < len(a):
			if a[j] == p:
				a[j] = 0
			j += 1
		b = chr(ord(b) + 1)
	elif a[i] == 0:
		i += 1
		continue
	else:
		flag = 1
		break
	i += 1
if flag == 1:
	print('NO')
else:
	print('YES')


alphabet = 'abcdefghijklmnopqrstuvwxyz'
programm = input()
for i in programm:
	if i in alphabet and i != alphabet[0]:
		print('NO')
		exit(0)
	if i == alphabet[0]:
		if len(alphabet) > 1:
			alphabet = alphabet[1:]
		else:
			break
print('YES')


str = list(input())
letters = list('abcdefghijklmnopqrstuvwxyz')
if len(str) == 1:
	if str[0] == 'a':
		print('YES')
	else:
		print('NO')
else:
	while len(str) > 0:
		if str[0] == letters[0]:
			while letters[0] in str:
				str.remove(letters[0])
			letters.remove(letters[0])
		else:
			print('NO')
			exit()
	print('YES')


n = input()
s = [int(i) for i in range(ord('a'), ord('z') + 1)]
s = s[::-1]
for i in n:
	a = ord(i)
	if len(s) == 0:
		break
	elif a == s[-1]:
		s.pop()
	elif a > s[-1]:
		print('NO')
		exit()
print('YES')


a = input()
t = 97
d = 1
while a != '':
	b = ''
	if ord(a[0]) == t:
		for i in a:
			if ord(i) != t:
				b = b + i
	else:
		d = 0
	t += 1
	a = b
if d == 1:
	print('YES')
else:
	print('NO')


s = str(input())
a = 'abcdefghijklmnopqrstuvwxyz'
l_s = list(s)
l_a = list(a)
i = len(l_s)
ans = 'NO'
while i:
	if l_s[0] != l_a[0]:
		ans = 'NO'
		break
	else:
		while l_a[0] in l_s:
			l_s.remove(l_a[0])
			i -= 1
			if len(l_s) == 0:
				ans = 'YES'
				break
		l_a.remove(l_a[0])
print(ans)


s = input()
x = 0
i = 0
h = len(s)
p = 'abcdefghijklmnopqrstuvwxyz'
while h:
	if s[i] == p[i]:
		s = s.replace(s[i], '')
		p = p.replace(p[i], '')
	else:
		print('NO')
		x = x + 1
		break
	h = len(s)
if x == 0:
	print('YES')


s = input()
if s[0] != 'a':
	print('NO')
else:
	last = 'a'
	was = [0] * 30
	was[0] = 1
	for i in range(1, len(s)):
		if was[ord(s[i]) - ord('a')]:
			pass
		elif ord(s[i]) == ord(last) + 1:
			last = s[i]
			was[ord(s[i]) - ord('a')] = 1
		else:
			print('NO')
			exit()
	print('YES')


s = input()
length = len(s)
a = ord('a')
i = 0
for c in s:
	if a + i < ord(c):
		print('NO')
		break
	if a + i == ord(c):
		i += 1
else:
	print('YES')


s = input()
mx = -1
for c in s:
	if ord(c) > ord('a') + mx + 1:
		print('NO')
		exit(0)
	else:
		mx = max(mx, ord(c) - ord('a'))
print('YES')


from sys import stdin, stdout

def ri():
	return map(int, stdin.readline().split())
s = list(input())
c = 'abcdefghijklmnopqrstuvwxyz'
for cc in c:
	if len(s) == 0:
		print('YES')
		exit()
	if s[0] != cc:
		print('NO')
		exit()
	s = [e for e in s if e != cc]
print('YES')


from math import inf, sqrt, floor, ceil
from collections import Counter, defaultdict, deque
from heapq import heappush as hpush, heappop as hpop, heapify as h
from operator import itemgetter
from itertools import product
from bisect import bisect_left, bisect_right
s = input()
find = set()
string = 'abcdefghijklmnopqrstuvwxyz'
ans = 'YES'
for i in range(len(s)):
	if i == 0:
		if s[i] != 'a':
			ans = 'NO'
			break
		else:
			find.add(s[0])
	elif s[i] not in find:
		ind = string.index(s[i])
		for j in range(ind):
			if string[j] not in find:
				ans = 'NO'
				break
		if ans == 'NO':
			break
		find.add(s[i])
print(ans)


def main():
	(m, s) = (96, set())
	for c in map(ord, input()):
		if c not in s:
			if not m < c < m + 2:
				print('NO')
				return
			else:
				m = c
				s.add(c)
	print('YES')
main()


def code(s):
	count = 0
	for i in range(len(s)):
		if ord(s[i]) - ord('a') > count:
			return 'NO'
		if ord(s[i]) - ord('a') == count:
			count += 1
	return 'YES'
print(code(input()))


s = input()
p = 0
for c in s:
	q = ord(c) - ord('a')
	if q == p:
		p += 1
	elif q > p:
		print('NO')
		exit()
print('YES')


3
import sys

def main():
	has = [False] * 26
	first = [-1] * 26
	cnt = 0
	s = input().strip()
	for i in range(len(s)):
		num = ord(s[i]) - ord('a')
		if not has[num]:
			has[num] = True
			first[num] = i
			cnt += 1
	for i in range(cnt):
		if not has[i]:
			print('NO')
			return
	for i in range(cnt, 26):
		if has[i]:
			print('NO')
			return
	for i in range(1, cnt):
		if first[i - 1] > first[i]:
			print('NO')
			return
	print('YES')
main()


s = input()
q = 97
for c in s:
	if not any((ord(c) == k for k in range(97, q + 1))):
		print('NO')
		break
	if ord(c) == q:
		q += 1
else:
	print('YES')


s = input()
w = [15234562] * 27
cnt = 0
for i in range(len(s)):
	if w[ord(s[i]) - ord('a')] == 15234562:
		w[ord(s[i]) - ord('a')] = i
		cnt += 1
for i in range(cnt):
	if w[i] >= w[i + 1]:
		print('NO')
		return
print('YES')


txt = input()
cur = 'a'
tx = [0 for i in range(200)]
flag = 1
if txt[0] != 'a':
	flag = 0
for i in txt:
	if ord(i) > ord(cur):
		if ord(i) != ord(cur) + 1 and tx[ord(i)] == 0:
			flag = 0
			break
		cur = i
	tx[ord(i)] += 1
if flag:
	print('YES')
else:
	print('NO')


s = input()
s1 = sorted(set(s), key=s.index)
for i in range(len(s1)):
	if s1[i] != chr(97 + i):
		exit(print('NO'))
print('YES')


s = input()
c = ord('a') - 1
for i in range(len(s)):
	if ord(s[i]) > c + 1:
		print('NO')
		exit()
	c = max(c, ord(s[i]))
print('YES')


s = input()
if s[0] != 'a':
	print('NO')
else:
	maxs = s[0]
	for i in range(1, len(s)):
		if ord(s[i]) - ord(maxs) > 1:
			print('NO')
			break
		if ord(s[i]) > ord(maxs):
			maxs = s[i]
	else:
		print('YES')


import string
s = input()
arr = ''
for char in s:
	if char not in arr:
		arr += char
if arr == string.ascii_lowercase[:len(arr)]:
	print('YES')
else:
	print('NO')


s = input()
a = sorted(set(s))
b = []
counter = 0
for i in range(len(s)):
	if s[i] not in b:
		b.append(s[i])
		if ord(b[counter]) - 97 != counter:
			print('NO')
			exit()
		counter += 1
if a == b and a[0] == 'a':
	print('YES')
else:
	print('NO')


x = input()
lastletter = 'a'
used = set()
for i in range(len(x)):
	if x[i] not in used and x[i] != lastletter:
		print('NO')
		exit(0)
	elif x[i] == lastletter:
		lastletter = chr(ord(lastletter) + 1)
	used.add(x[i])
print('YES')


s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
i = a.index(max(s))
a = a[:i + 1]
c = -1
for l in a:
	if l in s and s.index(l) > c:
		c = s.index(l)
	else:
		print('NO')
		break
else:
	print('YES')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

def LS():
	return input().split()

def S():
	return input()

def main():
	s = S()
	t = ord('a') - 1
	for c in s:
		ct = ord(c)
		if ct <= t:
			continue
		if ct - 1 == t:
			t = ct
			continue
		return 'NO'
	return 'YES'
print(main())


s = [ord(x) for x in input()]
m = ord('a') - 1
for i in s:
	if i - m > 1:
		print('NO')
		exit()
	m = max(i, m)
print('YES')


s = input()
last = -1
for i in range(26):
	c = chr(ord('a') + i)
	kk = s.find(c)
	if kk == -1:
		kk = len(s)
	if kk < last:
		print('NO')
		return
	last = kk
print('YES')


ords = {ord('a') - 1}
for n in [ord(c) for c in input()]:
	if n > max(ords) + 1:
		print('NO')
		break
	else:
		ords.add(n)
else:
	print('YES')


s = input()
d = [0] * 26
for i in s:
	d[ord(i) - ord('a')] += 1
	for k in range(ord(i) - ord('a')):
		if d[k] == 0:
			print('NO')
			exit()
print('YES')


alpha = 'abcdefghijklmnopqrstuvwxyz'
s = input()
line = []
for i in range(len(s)):
	line += [False]
yes = True
for i in range(len(alpha)):
	element = alpha[i]
	go = False
	for i in range(len(s)):
		if not line[i]:
			if s[i] == element:
				line[i] = True
				go = True
			elif not go:
				yes = False
				break
if yes:
	print('YES')
else:
	print('NO')


s = input()
r = []
if s[0] != 'a':
	print('NO')
else:
	r.append('a')
	ans = 'yes'
	for i in range(1, len(s)):
		if s[i] in r:
			continue
		elif ord(s[i]) - ord(r[-1]) == 1:
			r.append(s[i])
		else:
			ans = 'no'
	print(ans.upper())


import string

def solve(seq):
	ref = list(string.ascii_lowercase)
	index = 0
	for x in seq:
		if x > ref[index]:
			return 'NO'
		elif x == ref[index]:
			if index == 25:
				continue
			index += 1
	return 'YES'
print(solve(input()))


s = input()
l = list(set(s))
l.sort()
if l[0] != 'a':
	print('NO')
else:
	c = 1
	for i in range(len(l) - 1):
		if not chr(ord(l[i]) + 1) == l[i + 1] or not s.index(l[i]) < s.index(l[i + 1]):
			c = 0
			print('NO')
			break
	if c:
		print('YES')


x = []
for i in input():
	if i not in x:
		x += (i,)
print('YES' if x == [chr(97 + i) for i in range(len(x))] else 'NO')


import sys
s = input()
cur = ord('a')
for ch in s:
	if cur < ord(ch):
		print('NO')
		sys.exit()
	elif cur == ord(ch):
		cur += 1
print('YES')


c = ord('a') - 1
for s in map(ord, input()):
	if s > c + 1:
		print('NO')
		exit()
	c = max(c, s)
print('YES')


c = 1
cases = 1
while c <= cases:
	s = input()
	check = set()
	ans = 'YES'
	if s[0] != 'a':
		ans = 'NO'
	else:
		check.add('a')
	comp = True
	for i in s:
		if comp == False or ans == 'NO':
			break
		comp = False
		for j in check:
			if ord(i) > ord(j) and ord(i) - ord(j) == 1:
				comp = True
				break
			if ord(i) <= ord(j):
				comp = True
				break
		if comp:
			check.add(i)
	if comp == False:
		ans = 'NO'
	print(ans)
	c = c + 1


a = list(input())
b = []
for i in a:
	if i not in b:
		b.append(i)
for i in range(len(b)):
	if ord(b[i]) - ord('a') != i:
		exit(print('NO'))
print('YES')


a = input()
x = 96
b = ''
c = []
for i in set(a):
	if x < ord(i):
		x = ord(i)
for i in range(97, x + 1):
	if chr(i) in a:
		b += chr(i)
	else:
		print('NO')
		exit(0)
for i in b:
	c.append(a.index(i))
d = sorted(c)
if d == c:
	print('YES')
else:
	print('NO')


s = input()
i = 0
f = True
while len(s):
	if s[0] != chr(97 + i):
		f = False
		break
	s = s.replace(chr(97 + i), '')
	i += 1
print('YES' if f else 'NO')


import string
import sys
s = input()
t = sorted(set(s))
st = string.ascii_lowercase[:len(t)]
if t != list(st):
	print('NO')
	sys.exit()
for x in range(len(t)):
	if st[x] == s[0]:
		s = s.replace(st[x], '')
	else:
		print('NO')
		sys.exit()
print('YES')


3
s = input()
mx = -1
for c in s:
	if ord(c) > ord('a') + mx + 1:
		print('NO')
		return
	else:
		mx = max(mx, ord(c) - ord('a'))
print('YES')


k = ord('a') - 1
for i in input():
	if ord(i) - k > 1:
		print('NO')
		break
	if ord(i) > k:
		k += 1
else:
	print('YES')


import string
obf = [x for x in input()]
obf = [x for (i, x) in enumerate(obf) if x not in obf[:i]]
n = len(obf)
letters = list(string.ascii_lowercase)
letters = letters[:n]
if obf == letters:
	print('Yes')
else:
	print('No')


import string
line = input()
letters = {}
for i in string.ascii_lowercase:
	letters[i] = 0
letters['a'] = 1
flag = True
for j in line:
	if letters[j] == 1:
		if j == 'z':
			break
		else:
			letters[string.ascii_lowercase[string.ascii_lowercase.index(j) + 1]] = 1
	else:
		flag = False
		break
if flag:
	print('YES')
else:
	print('NO')


s = str(input())
l = list(s)
ss = list(set(l))
ss.sort()
for i in range(len(ss)):
	if ss[i] != chr(ord('a') + i):
		print('NO')
		exit()
ll = [-1 for i in range(len(ss))]
for i in range(len(ss)):
	c = chr(ord('a') + i)
	for j in range(len(l)):
		if l[j] == c:
			ll[i] = j
			break
lll = ll[:]
lll.sort()
if lll != ll:
	print('NO')
	exit()
print('YES')


s = input()
l = [0] * 26
ans = True
for ch in s:
	x = ord(ch) - ord('a')
	l[x] += 1
	for i in range(0, x):
		if l[i] == 0:
			ans = False
			break
if ans:
	for i in range(0, 26):
		if l[i] == 0:
			for j in range(i + 1, 26):
				if l[j] > 0:
					ans = False
					break
			break
if ans:
	print('YES')
else:
	print('NO')


S = input()
for c in 'abcdefghijklmnopqrstuvwxyz':
	lst = S.split(c)
	if len(lst) > 0 and lst[0] == '':
		S = ''.join(lst)
		if S == '':
			print('YES')
			S = 'haha'
			break
	else:
		S = ''
		break
if S == '':
	print('NO')


a = input()
x = 97
for i in a:
	if ord(i) < x:
		continue
	elif ord(i) == x:
		x += 1
	else:
		print('NO')
		exit(0)
print('YES')


from string import ascii_lowercase
rmv = lambda c, s: ''.join([ch for ch in s if ch != c])
cur = iter(ascii_lowercase)
s = input()
while len(s):
	c = next(cur)
	if s[0] != c:
		print('NO')
		exit(0)
	s = rmv(c, s)
print('YES')


obfuscation = input()
letters = 'abcdefghijklmnopqrstuvwxyz'
obfuscation = list(obfuscation)
letters = list(letters)
i = len(obfuscation)
posibility = 'NO'
while i:
	if obfuscation[0] != letters[0]:
		posibility = 'NO'
		break
	else:
		while letters[0] in obfuscation:
			obfuscation.remove(letters[0])
			i -= 1
			if len(obfuscation) == 0:
				posibility = 'YES'
				break
		letters.remove(letters[0])
print(posibility)


s = input()
a = -1
for x in s:
	if ord(x) - 97 - a > 1:
		print('NO')
		break
	else:
		a = max(a, ord(x) - 97)
else:
	print('YES')


string = input()
sorted_string = sorted(set(string), key=string.index)
for i in range(0, len(sorted_string)):
	if sorted_string[i] == chr(97 + i):
		continue
	else:
		exit(print('NO'))
print('YES')


n = input()
base = ord('a')
if ord(n[0]) != base:
	print('NO')
	exit(0)
for i in range(len(n)):
	if ord(n[i]) == base:
		continue
	elif ord(n[i]) == base + 1:
		base += 1
		continue
	elif ord(n[i]) > base:
		print('NO')
		exit(0)
	else:
		continue
print('YES')


s = input()
tmp = 'a'
for i in s:
	if i > tmp:
		print('NO')
		exit()
	if i == tmp:
		tmp = chr(ord(tmp) + 1)
print('YES')


s = input()
se = set()
ind = 0
alph = 'abcdefghijklmnopqrstuvwxyz'
ans = True
for i in s:
	if i in se:
		continue
	elif i == alph[ind]:
		se.add(i)
		ind += 1
		continue
	else:
		ans = False
		break
if ans:
	print('YES')
else:
	print('NO')


t = input()
k = list(set(t))
k.sort()
for i in range(len(k)):
	if ord(k[i]) != 97 + i:
		print('NO')
		exit()
l1 = float('-inf')
for i in k:
	var = t.index(i)
	if l1 < var:
		l1 = var
	else:
		print('NO')
		exit()
print('YES')


str = input()
cur = 'a'
flag = True
for ch in str:
	if ch == cur:
		cur = chr(ord(cur) + 1)
	elif ch > cur:
		flag = False
		break
print('YES' if flag else 'NO')


n = input()
k = 96
for i in n:
	if ord(i) - k > 1:
		k = 0
		break
	elif ord(i) - k == 1:
		k += 1
if k:
	print('YES')
else:
	print('NO')


Alphabet = 'abcdefghijklmnopqrstuvwxyz'
X = input()
Checked = []
(i, Index) = (0, 0)
while i < len(X):
	if X[i] not in Checked and X[i] == Alphabet[Index]:
		Checked.append(Alphabet[Index])
		Index += 1
	elif X[i] not in Checked and X[i] != Alphabet[Index]:
		print('NO')
		exit()
	i += 1
print('YES')


s = input()
ans = 'YES'
i = 97
while i < 123 and len(s) > 0:
	if chr(i) == s[0]:
		s = s.replace(chr(i), '')
	else:
		ans = 'NO'
		break
	i = i + 1
print(ans)


def manners(s):
	if s[0] != 'a':
		return 'NO'
	b = 97
	for i in range(1, len(s)):
		if b < ord(s[i - 1]):
			b = ord(s[i - 1])
		if ord(s[i]) - b > 1:
			return 'NO'
	return 'YES'
print(manners(input()))


def Obfuscate(s):
	letters = list('abcdefghijklmnopqrstuvwxyz')
	used = []
	for i in s:
		if i in used:
			pass
		elif i == letters[0] and i not in used:
			used.append(letters.pop(0))
		elif i not in used:
			print('NO')
			break
	else:
		print('YES')
Obfuscate(input())


string = str(input())
expected = 97
output = 1
for j in range(len(string)):
	if string[j] == chr(expected):
		expected += 1
	elif ord(string[j]) < expected:
		continue
	else:
		output = 0
		break
if output == 1:
	print('YES')
else:
	print('NO')


def main():
	s = input()
	letters = ''
	for i in range(26):
		letters += chr(i + ord('a'))
	marked = [False] * 26
	ind = 0
	for c in s:
		if marked[ord(c) - ord('a')]:
			continue
		if letters[ind] != c:
			print('NO')
			return
		marked[ind] = True
		ind += 1
	print('YES')
main()


s = input()
t = []
s1 = list(dict.fromkeys(s))
l = len(s1)
k = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
if s1 == k[:l]:
	print('YES')
else:
	print('NO')


S = input()
for ch in 'abcdefghijklmnopqrstuvwxyz_':
	if not S:
		print('YES')
		break
	if S[0] != ch:
		print('NO')
		break
	S = S.replace(ch, '')


s = input().strip()
iter = 'a'
for i in range(len(s)):
	if ord(s[i]) < ord(iter):
		continue
	elif ord(s[i]) == ord(iter):
		iter = chr(ord(iter) + 1)
	else:
		print('NO')
		exit()
print('YES')


s = list(input())
w = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
st = []
for k in range(len(s)):
	if s[k] not in st:
		st.append(s[k])
if st == w[:len(st)]:
	print('YES')
else:
	print('NO')


import sys
import math
s = input()
cur = 0
flag = True
for i in range(len(s)):
	x = ord(s[i]) - 97
	if x > cur:
		flag = False
		break
	elif x == cur:
		cur += 1
if flag:
	print('YES')
else:
	print('NO')


mx = int(96)
for ch in input():
	if ord(ch) > mx + 1:
		print('NO')
		break
	mx = max(ord(ch), mx)
else:
	print('YES')


s = input()
p = 0
flag = 1
for c in s:
	if ord(c) - ord('a') == p:
		p += 1
	elif ord(c) - ord('a') > p:
		flag = 0
		break
if flag == 1:
	print('YES')
else:
	print('NO')


def main():
	text = input()
	if text[0] != 'a':
		print('NO')
		return
	prev = text[0]
	for i in range(len(text)):
		if ord(text[i]) > ord(prev) + 1:
			print('NO')
			return
		if ord(text[i]) == ord(prev) + 1:
			prev = text[i]
	print('YES')
main()


code = input()
if code[0] == 'a':
	strt = []
	for i in range(26):
		strt.append(-1)
	for i in range(len(code)):
		index = ord(code[i]) - 97
		if index > -1 and index < len(strt) and (strt[index] == -1):
			strt[index] = i
	j = 0
	while j < len(strt) - 1 and strt[j] != -1:
		if strt[j] < strt[j + 1]:
			j += 1
		else:
			break
	if len(set(strt[j + 1:])) <= 1:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


a = list(input())
b = a
a = list(set(a))
c = []
for k in range(len(b)):
	if b[k] not in c:
		c.append(b[k])
a.sort()
if ord(a[len(a) - 1]) == 96 + len(a) and a == c:
	print('YES')
else:
	print('NO')


s = input()
l = 'abcdefghijklmnopqrstuvwxyz'
z = ''
for i in range(len(s)):
	if len(z) == 0:
		z = z + s[i]
	elif s[i] not in z:
		z = z + s[i]
n = len(z)
if z == l[:n]:
	print('YES')
else:
	print('NO')


s = input()
m = ord('a') - 1
for i in range(len(s)):
	c = ord(s[i])
	if c > m + 1:
		print('NO')
		return
	m = max(m, c)
print('YES')


code = input()
b = 96
res = True
for k in code:
	if ord(k) > b + 1:
		res = False
	elif ord(k) == b + 1:
		b += 1
if res:
	print('YES')
else:
	print('NO')


import sys
line = sys.stdin.readline()
expected = ord('a')
for c in line:
	if ord(c) > expected:
		print('NO')
		sys.exit()
	elif ord(c) == expected:
		expected += 1
print('YES')


code = input()
letters = 'abcdefghijklmnopqrstuvwxyz'
used = []
for letter in code:
	if letter not in used:
		if letter == letters[len(used)]:
			used.append(letter)
		else:
			print('NO')
			break
else:
	print('YES')


s = input()
c = ord('a')
for (i, char) in enumerate(s):
	if ord(char) <= c:
		pass
	else:
		if i == 0:
			break
		if ord(char) == c + 1:
			c += 1
		else:
			break
else:
	print('YES')
	exit()
print('NO')


s = input()
st = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
f = True
use = set()
last = -1
for i in range(len(s)):
	if s[i] in use:
		pass
	elif s[i] != st[last + 1]:
		f = False
		break
	else:
		use.add(s[i])
		last += 1
if f:
	print('YES')
else:
	print('NO')


import sys
character_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
string = sys.stdin.readline().strip()
last_first_pos = -1
length = 26
for i in range(length):
	first_pos = string.find(character_list[i])
	if first_pos != -1:
		if first_pos <= last_first_pos:
			print('NO')
			exit()
		last_first_pos = first_pos
	else:
		break
for j in range(i + 1, length):
	first_pos = string.find(character_list[j])
	if first_pos != -1:
		print('NO')
		exit()
print('YES')


from sys import exit

def chert(a, b):
	for i in range(len(b)):
		if b[i] != a[i]:
			return False
	return True
alphabet = ''.join([chr(i) for i in range(ord('a'), ord('z') + 1)])
s = input()
if ''.join(sorted(list(set(s)))) not in alphabet:
	print('NO')
	exit(0)
letters_so_far = ''
for i in s:
	if i not in letters_so_far:
		letters_so_far += i
if not chert(alphabet, letters_so_far):
	print('NO')
else:
	print('YES')


s = input()
current = 97
for i in s:
	if current < ord(i):
		print('NO')
		break
	elif current == ord(i):
		current += 1
else:
	print('YES')


class CodeforcesTask765BSolution:

	def __init__(self):
		self.result = ''
		self.code = ''

	def read_input(self):
		self.code = input()

	def process_task(self):
		used = {}
		obf = 'a'
		can = True
		for c in self.code:
			if c not in used:
				if c == obf:
					used[obf] = True
					obf = chr(ord(obf) + 1)
				else:
					can = False
					break
		self.result = 'YES' if can else 'NO'

	def get_result(self):
		return self.result
Solution = CodeforcesTask765BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import sys
string = sys.stdin.readline().strip()
last_symbol = '`'
answer = True
for letter in string:
	if ord(letter) - ord(last_symbol) > 1:
		answer = False
		break
	if letter > last_symbol:
		last_symbol = letter
if answer:
	print('YES')
else:
	print('NO')


s = input()
a = [0] * 26
l = []
for c in s:
	if c not in l:
		l.append(c)
	a[ord(c) - ord('a')] += 1
cnt = 0
for n in a:
	if n == 0:
		break
	cnt += n
if l == sorted(l) and cnt == len(s):
	print('YES')
else:
	print('NO')


st = list(input())
s = sorted(set(st), key=st.index)
n = len(s)
x = 'YES'
for i in range(n):
	if ord(s[i]) - 97 != i:
		x = 'NO'
print(x)


v = input()
s = list(v)
c = 'abcdefgijklmnopqrstuvwxyz'
p = 0
for i in range(len(s)):
	if p >= len(c):
		break
	if s[i] < c[p]:
		continue
	var = s[i]
	s[i] = c[p]
	for j in range(i + 1, len(s)):
		if s[j] == var:
			s[j] = c[p]
	p += 1
s = ''.join([i for i in s])
if s == v:
	print('YES')
else:
	print('NO')


s = input()
is_correct = True
for fs in range(26):
	for sc in range(fs + 1, 26):
		is_first = s.find(chr(ord('a') + fs))
		is_second = s.find(chr(ord('a') + sc))
		if is_second != -1:
			is_correct &= is_first != -1
			is_correct &= is_first < is_second
print('YES' if is_correct else 'NO')


def func():
	visited = set()
	next_char = ord('a')
	for c in input():
		if c not in visited:
			if ord(c) != next_char:
				print('NO')
				return
			else:
				visited.add(c)
				next_char += 1
	print('YES')
func()


s = list(input())
k = len(s)
r = []
k = 97
c = 0
f = 0
for i in range(len(s)):
	if ord(s[i]) <= k:
		c = c + 1
		r.append(ord(s[i]))
	elif ord(s[i]) == k + 1:
		if k in r:
			k = k + 1
			r.append(ord(s[i]))
		else:
			f = 1
			break
	else:
		f = 1
		break
if f == 1:
	print('NO')
else:
	print('YES')


s = input()
nxt = 'a'
for c in s:
	if c == nxt:
		nxt = chr(ord(nxt) + 1)
	elif c > nxt:
		print('NO')
		exit()
print('YES')


import math, sys, itertools
from decimal import *

def main():
	a = list('abcdefghijklmnopqrstuvwxyz')
	d = {}
	for c in a:
		d[c] = 0
	s = input()
	first = 'a'
	i = 0
	for c in s:
		if c > first:
			break
		if c == first:
			first = chr(ord(first) + 1)
		i += 1
	if i < len(s):
		print('NO')
	else:
		print('YES')
main()


s = input()
n = len(s)
letters = sorted(list(set(s)))
m = len(letters)
indices = [ord(l) - ord('a') for l in letters]
res = 'NO'
if indices == list(range(m)):
	res = 'YES'
	for i in range(m - 1):
		if s.index(letters[i]) > s.index(letters[i + 1]):
			res = 'NO'
print(res)


def main():
	s = input().strip()
	max_val = -1
	for c in s:
		n = ord(c) - ord('a')
		if n == max_val + 1:
			max_val += 1
		elif n > max_val:
			print('NO')
			return
	print('YES')
main()


a = input()
c = 'a'
while len(a) > 0:
	if a[0] != c:
		break
	a = a.replace(c, '')
	c = chr(ord(c) + 1)
if len(a) == 0:
	print('YES')
else:
	print('NO')


arr = list(input())
done = [False] * len(arr)
tar = list('abcdefghijklmnopqrstuvwxyz')
ti = 0
obs = True
for i in range(len(arr)):
	if done[i]:
		continue
	if tar[ti] != arr[i]:
		obs = False
		break
	ti += 1
	for j in range(i + 1, len(arr)):
		if done[j]:
			continue
		if arr[j] == arr[i]:
			done[j] = True
if obs:
	print('YES')
else:
	print('NO')


import sys
line = sys.stdin.readline().strip()
st = set()
po = -1
o = int()
while line:
	c = line[0]
	line = line[1:]
	o = ord(c) - ord('a')
	if o <= po:
		continue
	elif o == po + 1:
		po = o
	else:
		print('NO')
		exit(0)
print('YES')


l = [chr(i) for i in range(97, 123)]
s = input()
from collections import Counter
d = Counter()
m = []
f = 1
for i in s:
	for j in range(97, ord(i)):
		if chr(j) not in m:
			f = 0
			break
	m.append(i)
print('YES' if f else 'NO')


s = input()
visited = [0] * 26
for i in s:
	visited[ord(i) - ord('a')] = 1
	if i != 'a' and visited[ord(i) - ord('a') - 1] == 0:
		print('NO')
		exit()
print('YES')


from collections import Counter
import string
s = input()
c = Counter(s)
alpha = string.ascii_lowercase
i = 0
for data in zip(c, alpha):
	if data[0] != data[1]:
		print('NO')
		exit()
print('YES')


from string import ascii_lowercase

def can_decrypt(string):
	cur_idx = 0
	seen = set()
	for c in encoded:
		if c in seen:
			continue
		elif c != ascii_lowercase[cur_idx]:
			return False
		else:
			seen.add(ascii_lowercase[cur_idx])
			cur_idx += 1
	return True
encoded = input()
if can_decrypt(encoded):
	print('YES')
else:
	print('NO')


s = input()
idents = list('abcdefghijklmnopqrstuvwxyz')
possible = True
for x in s:
	if not idents:
		break
	elif x == idents[0]:
		idents.pop(0)
	elif x not in idents:
		continue
	else:
		possible = False
print('YES' if possible else 'NO')


import sys
s = input()
expected = ord('a')
for i in s:
	if ord(i) > expected:
		print('NO')
		sys.exit()
	elif ord(i) == expected:
		expected += 1
print('YES')


a = 'abcdefghijklmnopqrstuvwxyz'
c = 0
s = input().strip()
yes = 'YES'
for i in range(len(s)):
	if a[c] < s[i]:
		yes = 'NO'
		break
	if a[c] == s[i]:
		c += 1
	if c > len(a) - 1:
		break
print(yes)


alphabet = [chr(i) for i in range(97, 123)]
line = input()
obfuscated_array = []
for el in line:
	obfuscated_array.append(el)
point = 0
while len(obfuscated_array) != 0:
	if obfuscated_array[0] == alphabet[0]:
		for _ in range(obfuscated_array.count(alphabet[0])):
			obfuscated_array.remove(alphabet[0])
		alphabet.pop(0)
	else:
		print('NO')
		break
if len(obfuscated_array) == 0:
	print('YES')


def main():
	code = str(input())
	curr_a = 'a'
	while code:
		if code[0] != curr_a:
			print('NO')
			return
		code = code.replace(curr_a, '')
		curr_a = chr(ord(curr_a) + 1)
	print('YES')
	return
main()


s = list(input())
has = [0] * 26
j = 0
ans = 'YES'
for i in s:
	ind = ord(i) - ord('a')
	if j < ind:
		ans = 'NO'
		break
	elif j == ind:
		has[j] += 1
		j += 1
print(ans)


s = input()
l = []
for i in s:
	l.append(ord(i) - 97)
y = True
k = -1
for i in range(len(l)):
	if l[i] - k > 1:
		y = False
		break
	else:
		k = max(l[i], k)
if y:
	print('YES')
else:
	print('NO')


s = input().strip()
all = 'abcdefghijklmnopqrstuvwxyz'
p = 0
t = True
for i in s:
	if i in all[0:p]:
		pass
	elif i == all[p]:
		if p < 25:
			p += 1
	else:
		t = False
		break
if t == True:
	print('YES')
else:
	print('NO')


s = input()
flag = True
l = len(s)
max = ord('a') - 1
i = 0
while i < l and flag:
	cur = ord(s[i])
	if cur - max > 1:
		flag = False
	elif cur > max:
		max = cur
	i += 1
print('YES') if flag else print('NO')


s = input()
p = len(set(s))
flag = 0
l = []
for i in range(97, 123):
	if chr(i) in s:
		l.append(s.index(chr(i)))
	elif len(l) != p:
		flag = 1
		break
	else:
		break
if flag == 1:
	print('NO')
else:
	l1 = sorted(l)
	if l == l1:
		print('YES')
	else:
		print('NO')


a = input()
b = 'a'
c = 0
for i in range(0, len(a)):
	if b == a[i]:
		b = chr(ord(b) + 1)
		c += 1
	elif ord(a[i]) < ord(b):
		c += 1
if c == len(a):
	print('YES')
else:
	print('NO')


sc = 96
a = input()
for i in a:
	if ord(i) == sc + 1:
		sc += 1
	elif ord(i) > sc + 1:
		print('NO')
		exit(0)
print('YES')


def Neverending_competitions():
	n = int(input())
	home = input()
	for i in range(n):
		new = input()
	if n % 2 == 0:
		return 'home'
	else:
		return 'contest'

def Code_obfuscation():
	s = input()
	a = [0] * 26
	okay = True
	for i in s:
		for j in range(ord(i) - 97):
			if not a[j]:
				okay = False
				break
		if okay:
			a[ord(i) - 97] = 1
		else:
			break
	if okay:
		print('YES')
	else:
		print('NO')
Code_obfuscation()


n = input()
ff = False
m = len(n)
z = ord('a') - 1
while m:
	z += 1
	if z > ord('z'):
		ff = True
		print('NO')
		break
	f = False
	for i in n:
		if f:
			if i == chr(z):
				m -= 1
		elif ord(i) < z:
			pass
		elif ord(i) == z:
			f = True
			m -= 1
		else:
			print('NO')
			ff = True
			m = 0
			break
if not ff:
	print('YES')


s = list(input())
g = []
for x in s:
	g.append(ord(x) - 96)
c = 0
p = []
for x in g:
	if x not in p:
		p.append(x)
for x in p:
	c += 1
	if x != c:
		print('NO')
		exit()
print('YES')


import math
input_string = input()
map = []
first_index = []
for i in range(0, 26):
	map.append(0)
	first_index.append(math.inf)
for i in range(0, len(input_string)):
	if map[ord(input_string[i]) - 97] == 0:
		first_index[ord(input_string[i]) - 97] = i
	map[ord(input_string[i]) - 97] += 1
fault = False
for i in range(1, len(map)):
	if map[i - 1] == 0 and map[i] > 0:
		fault = True
		break
for i in range(0, len(first_index) - 1):
	if first_index[i] > first_index[i + 1]:
		fault = True
		break
if fault == True:
	print('NO')
else:
	print('YES')


from collections import defaultdict
import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
s = input()
s = list(set(s))
if 'a' not in s:
	print('NO')
	exit()
for i in range(0, len(s) - 1):
	if ord(s[i + 1]) - ord(s[i]) != 1:
		print('NO')
		exit()
print('YES')


import sys

def isObs(line):
	List = set()
	ret = True
	mx = ord('a')
	for x in line:
		if x not in List:
			List.add(x)
			if ord(x) <= mx:
				mx += 1
				continue
			else:
				ret = False
				break
	return ret

def main():
	obs = input().strip()
	print('YES' if isObs(obs) else 'NO')
main()


alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
k = 0
s = list(input())
while True:
	if len(s) == 0:
		print('YES')
		break
	if s[0] != alf[k]:
		print('NO')
		break
	else:
		i = 0
		while len(s) > i:
			if s[i] == alf[k]:
				del s[i]
			else:
				i += 1
		k += 1


import re
import math
ss = str(input())
mm = {}
maxnum = -1
suss = True
for s in ss:
	mm[s] = True
	if ord(s) - ord('a') > maxnum:
		maxnum = ord(s) - ord('a')
	if not maxnum + 1 == len(mm):
		suss = False
if not suss:
	print('NO')
else:
	print('YES')


curOrd = 97
S = input()
f = 1
for s in S:
	if ord(s) > curOrd:
		f = 0
		break
	elif ord(s) == curOrd:
		curOrd += 1
if f:
	print('YES')
else:
	print('NO')


program = input()
to_use = 'abcdefghijklmnopqrstuvwxyz'
used = ''
legal = True
for char in program:
	if char in used:
		continue
	elif char == to_use[0]:
		used += to_use[0]
		to_use = to_use[1:]
	else:
		legal = False
		break
if legal:
	print('YES')
else:
	print('NO')


x = input()
x_ = x.split()
x__ = [d for d in x]
reference_string = 'abcdefghijklmnopqrstuvwxyz'
unique = []
for num in x:
	if num not in unique:
		unique.append(num)
unique.sort()
y = ''
t = ''
for num in x__:
	if num not in y:
		y = y + num
if y in reference_string[:len(unique)]:
	print('YES')
else:
	print('NO')


import sys
import math
import itertools
import collections

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
s = input()
max = ord('a')
if s[0] != 'a':
	exit(print('NO'))
else:
	for c in s:
		if ord(c) - max == 1:
			max = ord(c)
		elif ord(c) - max > 1:
			exit(print('NO'))
	print('YES')


s = input()
mx = ord('a')
flag = True
for c in s:
	if ord(c) > mx:
		print('NO')
		flag = False
		break
	if ord(c) == mx:
		mx = mx + 1
if flag:
	print('YES')


s = input()
used = [96]
for i in range(len(s)):
	if ord(s[i]) > used[-1] + 1:
		print('NO')
		exit()
	elif ord(s[i]) == used[-1] + 1:
		used.append(ord(s[i]))
print('YES')


inp = list(input())
MAX = ord('a') - 1
for i in range(len(inp)):
	if ord(inp[i]) == MAX + 1:
		MAX = MAX + 1
	if ord(inp[i]) > MAX + 1:
		print('NO')
		exit()
print('YES')


def Main():
	inp = list(input())
	found = 0
	error = False
	for c in inp:
		p = ord(c) - ord('a') + 1
		if p == found + 1:
			found += 1
		elif p > found:
			error = True
			break
	if error == False:
		print('YES')
	else:
		print('NO')
Main()