Algorithm


A. Chat room
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Vasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word "hello". For example, if Vasya types the word "ahhellllloou", it will be considered that he said hello, and if he types "hlelo", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.

Input

The first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.

Output

If Vasya managed to say hello, print "YES", otherwise print "NO".

Examples
input
Copy
ahhellllloou
output
Copy
YES
input
Copy
hlelo
output
Copy
NO



 

Code Examples

#1 Code Example with C++ Programming

Code - C++ Programming

#include<bits/stdc++.h>
using namespace std;


#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  string s, r = "";
  cin>>s;

  for(auto i : s){
    if(i == 'h' && r == ""){
      r += i;
    }
    else if(i == 'e' && r[r.length() - 1] == 'h'){
      r += i;
    }
    else if(i == 'l' && r[r.length() - 1] == 'e'){
      r += i;
    }
    else if(i == 'l' && r[r.length() - 2] == 'e' && r[r.length() - 1] == 'l'){
      r += i;
    }
    else if(i == 'o' && r[r.length() - 1] == 'l' && r[r.length() - 2] == 'l' && r[r.length() - 3] == 'e'){
      r += i;
    }
  }
  (r == "hello") ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
ahhellllloou

Output

x
+
cmd
YES
Advertisements

Demonstration


Codeforcess Solution 58-A A. Chat room ,C++, Java, Js and Python ,58-A,Codeforcess Solution

Previous
Codeforces solution 1080-B-B. Margarite and the best present codeforces solution
Next
CodeChef solution DETSCORE - Determine the Score CodeChef solution C,C+