#include <bits/stdc++.h>
using namespace std;
string s;
string t = "heidi";
string t2 = "heidi";
long long j = 0, j2 = 0;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (long long i = 0; i < s.length(); ++i) {
    if (s[i] == t[j]) ++j;
    if (s[i] == t2[j2]) ++j2;
    if (j == t.length() || j2 == t2.length()) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
