#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, m;
  cin >> s;
  m = s;
  int a[s.length()], k = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'h' || s[i] == 'e' || s[i] == 'i' || s[i] == 'd' ||
        s[i] == 'i') {
      m[k] = s[i];
      k++;
    }
  }
  m = m.substr(0, k);
  int l = 0, i = 0;
  string p = "heidi";
  for (int j = 0; j < 5; j++) {
    for (; i < m.length() - 1; i++) {
      if (p[j] == m[i] && m[i] != m[i + 1]) {
        l++;
        break;
      } else if (i == m.length() - 2 && (m[i] == p[j] || m[i + 1] == p[j])) {
        l++;
      }
    }
  }
  if (l == 5)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
