import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int position = 0;
		int prev = 0;
		while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		}

		if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.util.Arrays; Arrays java.util class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int position = 0;
		int prev = 0;
		while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		}

		if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
} Main private static boolean isDebug = System.getProperty("sun.desktop") != null; isDebug System.getProperty("sun.desktop") != null System.getProperty("sun.desktop") System.getProperty System "sun.desktop" null public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int position = 0;
		int prev = 0;
		while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		}

		if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int position = 0;
		int prev = 0;
		while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		}

		if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int position = 0; position 0 int prev = 0; prev 0 while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		} position < S.length() position S.length() S.length S {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		} String current = S.substring(position, Math.min(position + 5, S.length())); current S.substring(position, Math.min(position + 5, S.length())) S.substring S position Math.min(position + 5, S.length()) Math.min Math position + 5 position 5 S.length() S.length S if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			} current.startsWith("dream") current.startsWith current "dream" {
				position += "dream".length();
				prev = 1;
			} position += "dream".length() position "dream".length() "dream".length "dream" prev = 1 prev 1 if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			} current.startsWith("er") current.startsWith current "er" {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} position += "er".length() position "er".length() "er".length "er" if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				} prev == 2 prev 2 {
					prev = 4;
				} prev = 4 prev 4 {
					prev = 2;
				} prev = 2 prev 2 if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			} current.startsWith("aser") current.startsWith current "aser" {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				} prev != 2 && prev != 4 prev != 2 prev 2 prev != 4 prev 4 {
					System.out.println("NO");
					return;
				} System.out.println("NO") System.out.println System.out System System.out "NO" return; position += "aser".length() position "aser".length() "aser".length "aser" prev = 3 prev 3 if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			} current.startsWith("ase") current.startsWith current "ase" {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				} prev != 2 && prev != 4 prev != 2 prev 2 prev != 4 prev 4 {
					System.out.println("NO");
					return;
				} System.out.println("NO") System.out.println System.out System System.out "NO" return; position += "ase".length() position "ase".length() "ase".length "ase" prev = 3 prev 3 {
				System.out.println("NO");
				return;
			} System.out.println("NO") System.out.println System.out System System.out "NO" return; if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		} prev == 4 prev 4 {
			System.out.println("NO");
		} System.out.println("NO") System.out.println System.out System System.out "NO" {
			System.out.println("YES");
		} System.out.println("YES") System.out.println System.out System System.out "YES" String[] args args private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	} debug {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	} if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		} isDebug {
			System.err.println(Arrays.deepToString(o));
		} System.err.println(Arrays.deepToString(o)) System.err.println System.err System System.err Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	} Scanner private BufferedInputStream inputStream; inputStream public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		} Scanner {
			inputStream = new BufferedInputStream(in);
		} inputStream = new BufferedInputStream(in) inputStream new BufferedInputStream(in) InputStream in in public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} nextInt {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} int num = 0; num 0 int read = skip(); read skip() skip do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				num = num * 10 + (read - 0x30);
			} num = num * 10 + (read - 0x30) num num * 10 + (read - 0x30) num * 10 num 10 (read - 0x30) read 0x30 return num; num public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		} fill {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		} for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextInt();
			} {
				a[i] = nextInt();
			} a[i] = nextInt() a[i] a i nextInt() nextInt int[] a a public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		} fill {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		} if (a.length != b.length) {
				throw new IllegalArgumentException();
			} a.length != b.length a.length a a.length b.length b b.length {
				throw new IllegalArgumentException();
			} throw new IllegalArgumentException(); new IllegalArgumentException() for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextInt();
				b[i] = nextInt();
			} {
				a[i] = nextInt();
				b[i] = nextInt();
			} a[i] = nextInt() a[i] a i nextInt() nextInt b[i] = nextInt() b[i] b i nextInt() nextInt int[] a a int[] b b public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} nextLong {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		} long num = 0; num 0 int read = skip(); read skip() skip do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				num = num * 10 + (read - 0x30);
			} num = num * 10 + (read - 0x30) num num * 10 + (read - 0x30) num * 10 num 10 (read - 0x30) read 0x30 return num; num public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		} fill {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		} for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextLong();
			} {
				a[i] = nextLong();
			} a[i] = nextLong() a[i] a i nextLong() nextLong long[] a a public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		} fill {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		} if (a.length != b.length) {
				throw new IllegalArgumentException();
			} a.length != b.length a.length a a.length b.length b b.length {
				throw new IllegalArgumentException();
			} throw new IllegalArgumentException(); new IllegalArgumentException() for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = nextLong();
				b[i] = nextLong();
			} {
				a[i] = nextLong();
				b[i] = nextLong();
			} a[i] = nextLong() a[i] a i nextLong() nextLong b[i] = nextLong() b[i] b i nextLong() nextLong long[] a a long[] b b public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		} nextLong {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		} long[] array = new long[n]; array new long[n] n for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				array[i] = nextLong();
			} {
				array[i] = nextLong();
			} array[i] = nextLong() array[i] array i nextLong() nextLong return array; array int n n public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		} next {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		} StringBuilder builder = new StringBuilder(); builder new StringBuilder() int read = skip(); read skip() skip do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20); (read = inputStream.read()) > 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 {
				builder.append((char) read);
			} builder.append((char) read) builder.append builder (char) read return builder.toString(); builder.toString() builder.toString builder private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		} skip {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		} int read; read while ((read = inputStream.read()) <= 0x20)
				; (read = inputStream.read()) <= 0x20 (read = inputStream.read()) read inputStream.read() inputStream.read inputStream 0x20 return read; read
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int position = 0;
		int prev = 0;
		while (position < S.length()) {
			String current = S.substring(position, Math.min(position + 5, S.length()));
			// debug(current);
			if (current.startsWith("dream")) {
				position += "dream".length();
				prev = 1;
			} else if (current.startsWith("er")) {
				position += "er".length();
				if (prev == 2) {
					prev = 4;
				} else {
					prev = 2;
				}
			} else if (current.startsWith("aser")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "aser".length();
				prev = 3;
			} else if (current.startsWith("ase")) {
				if (prev != 2 && prev != 4) {
					System.out.println("NO");
					return;
				}
				position += "ase".length();
				prev = 3;
			} else {
				System.out.println("NO");
				return;
			}
		}

		if (prev == 4) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}
