#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
const int MAXN = 1e3 + 3;
int n;
bool dp[MAXN][10];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  n = (int)s.length();
  string kek = "heidi";
  memset(dp, 0, sizeof(dp));
  for (auto i = 0; i != n; i++) {
    for (auto j = 0; j != 5; j++) {
      if (s[i] != kek[j]) continue;
      if (j > 0) {
        bool good = false;
        for (auto k = 0; k != i; k++)
          if (dp[k][j - 1]) {
            good = true;
            break;
          }
        if (!good) continue;
      }
      dp[i][j] = true;
    }
  }
  for (auto i = 0; i != n; i++)
    if (dp[i][4]) {
      cout << "YES";
      return 0;
    }
  cout << "NO";
  return 0;
}
