fbldqzggeunkpwcfirxanmntbfrudijltoertsdvcvcmbwodbibsrxendzebvxwydpasaqnisrijctsuatihxxygbeovhxjdptdcppkvfytdpjspvrannxavmkmisqtygntxkdlousdypyfkrpzapysfpdbyprufwzhunlsfugojddkmxzinatiwfxdqmgyrnjnxvrclhxyuwxtshoqdjptmeecvgmrlvuwqtmnfnfeeiwcavwnqmyustawbjodzwsqmnjxhpqmgpysierlwbbdzcwprpsexyvreewcmlbvaiytjlxdqdaqftefdlmtmmjcwvfejshymhnouoshdzqcwzxpzupkbcievodzqkqvyjuuxxwepxjalvkzufnveji
 arfbvxgdvqzuloojjrwoyqqbxamxybaqltfimofulusfebodjkwwrgwcppkwiodtpjaraglyplgerrpqjkpoggjmfxhwtqrijpijrcyxnoodvwpyjfpvqaoazllbrpzananbrvvybboedidtuvqquklkpeflfaltukjhzjgiofombhbmqbihgtapswykfvlgdoapjqntvqsaohmbvnphvyyhvhavslamczuqifxnwknkaenqmlvetrqogqxmlptgrmqvxzdxdmwobjesmgxckpmawtioavwdngyiwkzypfnxcovwzdohshwlavwsthdssiadhiwmhpvgkrbezm
 oagjghsidigeh
 diehi
 aftcrvuumeqbfvaqlltscnuhkpcifrrhnutjinxdhhdbzvizlrapzjdatuaynoplgjketupgaejciosofuhcgcjdcucarfvtsofgubtphijciswsvidnvpztlaarydkeqxzwdhfbmullkimerukusbrdnnujviydldrwhdfllsjtziwfeaiqotbiprespmxjulnyunkdtcghrzvhtcychkwatqqmladxpvmvlkzscthylbzkpgwlzfjqwarqvdeyngekqvrhrftpxnkfcibbowvnqdkulcdydspcubwlgoyinpnzgidbgunparnueddzwtzdiavbprbbg
 ehdii
 zcectngbqnejjjtsfrluummmqabzqbyccshjqbrjthzhlbmzjfxugvjouwhumsgrnopiyakfadjnbsesamhynsbfbfunupwbxvohfmpwlcpxhovwpfpciclatgmiufwdvtsqrsdcymvkldpnhfeisrzhyhhlkwdzthgprvkpyldeysvbmcibqkpudyrraqdlxpjecvwcvuiklcrsbgvqasmxmtxqzmawcjtozioqlfflinnxpeexbzloaeqjvglbdeufultpjqexvjjjkzemtzuzmxvawilcqdrcjzpqyhtwfphuonzwkotthsaxrmwtnlmcdylxqcfffyndqeouztluqwlhnkkvzwcfiscikv
 plqaykgovxkvsiahdbglktdlhcqwelxxmtlyymrsyubxdskvyjkrowvcbpdofpjqspsrgpakdczletxujzlsegepzleipiyycpinzxgwjsgslnxsotouddgfcybozfpjhhocpybfjbaywsehbcfrayvancbrumdfngqytnhihyxnlvilrqyhnxeckprqafofelospffhtwguzjbbjlzbqrtiielbvzutzgpqxosiaqznndgobcluuqlhmffiowkjdlkokehtjdyjvmxsiyxureflmdomerfekxdvtitvwzmdsdzplkpbtafxqfpudnhfqpoiwvjnylanunmagoweobdvfjgepbsymfutrjarlxclhgavpytiiqwvojrptofuvlohzeguxdsrihsbucelhhuedltnnjgzxwyblbqvnoliiydfinzlogbvucwykryzcyibnniggbkdkdcdgcsbvvnavtyhtkanrblpvomvjs
 edhii
 uuehrvufgerqbzyzksmqnewacotuimawhlbycdbsmhshrsbqwybbkwjwsrkwptvlbbwjiivqugzrxxwgidrcrhrwsmwgeoleptfamzefgaeyxouxocrpvomjrazmxrnffdwrrmblgdiabdncvfougtmjgvvazasnygdrigbsrieoonirlivfyodvulouslxosswgpdexuldmkdbpdlgutiotvxjyecbrsvbmqxrlcpcipjjncduyqtohlzybvlemmfdeubihwlwqglkgjvnwrbgydcpwklmjeewqklmqdbajqgrpnynaxfvxjzgibqerxyhnxenrmcdqaaeksbzyrcaepozqpetaurlhjuxxhwppuhgoihxdxbmxeiahyaqkbknktlzkheaarjoqqrsyeducvoygwalgarldcdlqogfvsncejssmx
 iheid
 pnjdwpxmvfoqkjtbhquqcuredrkwqzzfjmdvpnbqtypzdovemhhclkvigjvtprrpzbrbcbatkucaqteuciuozytsptvsskkeplaxdaqmjkmef
 vllsexwrazvlfvhvrtqeohvzzresjdiuhomfpgqcxpqdevplecuaepixhlijatxzegciizpvyvxuembiplwklahlqibykfideysjygagjbgqkbhdhkatddcwlxboinfuomnpc
 jpwfhvlxvsdhtuozvlmnfiotrgapgjxtcsgcjnodcztupysvvvmjpzqkpommadppdrykuqkcpzojcwvlogvkddedwbggkrhuvtsvdiokehlkdlnukcufjvqxnikcdawvexxwffxtriqbdmkahxdtygodzohwtdmmuvmatdkvweqvaehaxiefpevkvqpyxsrhtmgjsdfcwzqobibeduooldrmglbinrepmunizheqzvgqvpdskhxfidxfnbisyizhepwyrcykcmjxnkyfjgrqlkixcvysa
 eihdi
 htsyljgoelbbuipivuzrhmfpkgderqpoprlxdpasxhpmxvaztccldtmujjzjmcpdvsdghzpretlsyyiljhjznseaacruriufswuvizwwuvdioazophhyytvbiogttnnouauxllbdn
 eufyajkssayhjhqcwxmctecaeepjwmfoscqprpcxsqfwnlgzsmmuwuoruantipholrauvxydfvftwfzhnckxswussvlidcojiciflpvkcxkkcmmvtfvxrkwcpeelwsuzqgamamdtdgzscmikvojfvqehblmjczkvtdeymgertgkwfwfukafqlfdhtedcctixhyetdypswgagrpyto
 lgirxqkrkgjcutpqitmffvbujcljkqardlalyigxorscczuzikoylcxenryhskoavymexysvmhbsvhtycjlmzhijpuvcjshyfeycvvcfyzytzoyvxajpqdjtfiatnvxnyeqtfcagfftafllhhjhplbdsrfpctkqpinpdfrtlzyjllfbeffputywcckupyslkbbzpgcnxgbmhtqeqqehpdaokkjtatrhyiuusjhwgiiiikxpzdueasemosmmccoakafgvxduwiuflovhhfhffgnnjhoperhhjtvocpqytjxkmrknnknqeglffhfuplopmktykxuvcmbwpoeisrlyyhdpxfvzseucofyhziuiikihpqheqdyzwigeaqzhxzvporgisxgvhyicqyejovqloibhbunsvsunpvmdckkbuokitdzleilfwutcvuuytpupizinfjrzhxudsmjcjyfcpfgthujjowdwtgbvi
 deiih
 chdhzpfzabupskiusjoefrwmjmqkbmdgboicnszkhdrlegeqjsldurmbshijadlwsycselhlnudndpdhcnhruhhvsgbthpruiqfirxkhpqhzhqdfpyozolbionodypfcqfeqbkcgmqkizgeyyelzeoothexcoaahedgrvoemqcwccbvoeqawqeuusyjxmgjkpfwcdttfmwunzuwvsihliexlzygqcgpbdiawfvqukikhbjerjkyhpcknlndaystrgsinghlmekbvhntcpypmchcwoglsmwwdulqneuabuuuvtyrnjxfcgoothalwkzzfxakneusezgnnepkpipzromqubraiggqndliz
 bpvbpjvbdfiodsmahxpcubjxdykesubnypalhypantshkjffmxjmelblqnjdmtaltneuyudyevkgedkqrdmrfeemgpghwrifcwincfixokfgurhqbcfzeajrgkgpwqwsepudxulywowwxzdxkumsicsvnzfxspmjpaixgejeaoyoibegosqoyoydmphfpbutrrewyjecowjckvpcceoamtfbitdneuwqfvnagswlskmsmkhmxyfsrpqwhxzocyffiumcy
 ikmxzqdzxqlvgeojsnhqzciujslwjyzzexnregabdqztpplosdakimjxmuqccbnwvzbajoiqgdobccwnrwmixohrbdarhoeeelzbpigiybtesybwefpcfx
 iiopulfjxoitgiusqrhgbkiyzinphjtclodbkkydetylvuimkhdkklmyoacmekdvjpuxcrvqnjhqhhbfenlpzpwijtykqziocilvtpqhxuyrphdlamawjuzgjwiebkqyrzyqgtkcrhntjxqmcgkrqcslogjegfrivzidfedeegwbbsopvxvdoididlpypjogxaodtueebbwuwilacunqpozczcgrpaxxrtogpxgfkudtxchoravrrdtimhenwmnafxaruuojduxxglefejycfcyxllfimkszmbrhcwpnwjqgwvzysmlaaifdxfjjpgjmcksiigpanappjdloiolojmcqbnpnjjzaufdpjaknylmyvolhwypygwepmqwpiglpcnpypnudhdzpdvgzosyjthzcwtytxq
 ihied

YES YES NO NO YES NO YES YES NO YES NO NO YES YES NO YES YES YES NO YES YES YES YES NO
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#include "bits/stdc++.h"

/* 
||¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶||
||¶¶__________________________________¶¶||
||¶¶__________________________________¶¶||
||¶¶_________________________________¶¶_||
||¶¶_________________________________¶¶_||
||_¶¶_______________________________¶¶__||
||_¶¶______________________________¶¶___||
||__¶¶¶__________________________¶¶¶____||
||___¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶_____||
||_____¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶_______||
||_______¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶_________||
||_________¶¶¶¶¶_¶¶¶¶¶¶¶_¶¶¶¶___________||
||____________¶¶¶¶_¶¶¶_¶¶¶______________||
||______________¶¶¶_¶_¶¶________________||
||_______________¶¶¶_¶¶_________________||
||________________¶¶_¶¶_________________||
||________________¶¶_¶__________________||
||________________¶¶_¶¶_________________||
||______________¶¶¶_¶_¶¶¶_______________||
||___________¶¶¶¶¶__¶__¶¶¶¶¶____________||
||________¶¶¶¶¶_____¶_____¶¶¶¶__________||
||______¶¶¶¶________¶_______¶¶¶¶¶_______||
||_____¶¶¶__________¶__________¶¶¶¶_____||
||___¶¶¶____________¶____________¶¶¶____||
||__¶¶¶_____________¶______________¶¶___||
||_¶¶¶______________¶_______________¶¶__||
||_¶¶_______________¶________________¶¶_||
||¶¶_______________¶¶¶________________¶¶||
||¶¶______________¶¶¶¶¶_______________¶_||
||¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶||
||¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶||
||¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶||
			GG: faster pliiz																		
*/

using namespace std;
using ll = long long;
using ld = long double;

#define F first
#define S second
#define B break
#define E exit(0)
#define endl '\n'

#define ins insert
#define rev reverse
#define pb push_back
#define em emplace
#define eb emplace_back
#define pf push_front
#define ppf pop_front
#define ppb pop_back
#define ccon continue

#define sz(s) s.size()
#define lb lower_bound()
#define ub upper_bound()
#define mkp make_pair
#define all(v) v.begin(), v.end()
#define whole(a,x) a + 1, a + x + 1
#define rall(v) v.rbegin(), v.rend()
#define out(v) copy(all(v),ostream_iterator<int>(cout," ")); 
#define int ll 

using si = set<int>;
using msi = multiset<int>;
using usi = unordered_set<int>;
using vi = vector<int>;
using vs = vector<string>;
using pii = pair<int,int>;
using vpii = vector<pii>;
using psi = pair<string,int>;
using mii = unordered_map<int,int>;
using mib = unordered_map<int,bool>;

#define map unordered_map

inline void setpr (int a, double b){cout << fixed << setprecision(a) << b;}

#define SM(n) ((n) * (n + 1) / 2)
#define gcd __gcd
#define lcm(a,b) ((a) * (b) / gcd(a,b))

inline int F(int n){int sum=1;for(int i=2;i<=n;i++){sum*=i;}return sum;}
inline bool prime(int n){for(int i=2;i<=sqrt(n);i++){if(n%i==0){return 0;}}return 1;}
inline int pow(int a,int b){int res=1;while(b){if(b&1)res*=a;a*=a;b>>=1;}return res;}

inline string to_binary(int x){string s;while(x>0){s+=(x%2?'1':'0');x/=2;}reverse(all(s));return s;}
string ALLSTARS="abcdefghijklmnopqrstuvwxyz";
string ALLNOTSTARS="qwertyuiopasdfghjklzxcvbnm";

struct st{int fi,se,th,fr;};

const int MyIQ = 1e18 * 0 - 7;
const int E3 = 1e3 + 7;
const int E4 = 1e4 + 7;
const int E5 = 1e5 + 7;
const int E6 = 1e6 + 7;
const int E9 = 1e8 + 7; 
const ll INF = 1e18 + 7;

// aeiyou

template <typename TN>
class SOL {	
	private:
		TN t;
	public:
		void KOD() {
			string s;
			cin >> s;
			int frh = -1, fre = -1, fri = -1, frd = -1, fr2i = -1;
			for (int i = 0; i < sz(s); i++) {
				if (s[i] == 'h' && frh<0) frh = i;
				if (s[i] == 'e' && fre<0) if (i > frh) fre = i;
				if (s[i] == 'd' && frd<0) if (i > fri) frd = i;
				if (s[i] == 'i' && fri<0) if (i > fre) fri = i;
				if (s[i] == 'i' && fr2i<fri) if (i > frd && i > fri) fr2i = i;
			}
			if (frh > -1 && frh < fre && fre < fri && fri < frd && frd < fr2i) 
				cout << "YES\n";
			else cout << "NO\n";
		}
		void KOD2() {
			cin >> t;
			while (t--) {
				SOL<int>DW; 
				DW.KOD();
			}
		}
};


main() {
#ifdef _
	freopen ("perm.in", "r", stdin);
	freopen ("perm.out", "w", stdout);
#endif
	ios_base::sync_with_stdio(NULL);
	cin.tie (nullptr);
	cout.tie (nullptr);
	SOL<int>DD; 
//	DD.KOD2();
	DD.KOD();
	return false;
}