#include <bits/stdc++.h>
using namespace std;
bool cop(string s1, string s2) {
  if (s1.size() != s2.size()) return false;
  for (long long x = 0; x < s1.size(); x++) {
    if (s1[x] != s2[x]) return false;
  }
  return true;
}
void solve() {
  string s, s1;
  cin >> s;
  long long a[5]{0};
  for (long long x = 0; x < s.size(); x++) {
    if (s[x] == 'h' && a[0] == 0) {
      a[0]++;
      s1 += 'h';
    }
    if (s[x] == 'e' && a[0] > 0 && a[1] == 0) {
      a[1]++;
      s1 += 'e';
    }
    if (s[x] == 'i' && a[1] > 0 && a[2] == 0) {
      a[2]++;
      s1 += 'i';
    }
    if (s[x] == 'd' && a[2] > 0 && a[3] == 0) {
      a[3]++;
      s1 += 'd';
    }
    if (s[x] == 'i' && a[3] > 0 && a[4] == 0) {
      a[4]++;
      s1 += 'i';
    }
  }
  cop("heidi", s1) ? cout << "YES" : cout << "NO";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
