Language: C++

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

#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,0,n)
#define rrep3(i,begin,end) for(int i=(int)(end-1),i##_end=(int)(begin);i>=i##_end;--i)
#define each(x,a) for(auto&x:a)
#define sz(x) ((int)(x).size())

struct IoSetup{
  IoSetup(){
    cin.tie(nullptr);
    // ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  };
} ioSetup;

using ull=unsigned long long;
using ll=long long;
using p=pair<ll, ll>;
using vp=vector<pair<ll, ll>>;
using vs=vector<string>;
using vi=vector<ll>;
using vvi=vector<vi>;
#define v(T) vector<T>
#define vv(T) v(v(T))

template<class T,class U>ostream &operator<<(ostream &o,const pair<T,U>&j){o<<"{"<<j.first<<", "<<j.second<<"}";return o;}
template<class T,class U>ostream &operator<<(ostream &o,const map<T,U>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const set<T>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const multiset<T>&j){o<<"{";for(auto t=j.begin();t!=j.end();++t)o<<(t!=j.begin()?", ":"")<<*t;o<<"}";return o;}
template<class T>ostream &operator<<(ostream &o,const vector<T>&j){o<<"{";for(int i=0;i<(int)j.size();++i)o<<(i>0?", ":"")<<j[i];o<<"}";return o;}
#ifdef LOCAL
inline void dump(void){cerr<<endl;}
template<class Head,class... Tail> inline void dump(Head&& head,Tail&&... tail){cerr<<head<<" ";dump(tail...);}
#define debug(...) do{cerr<<"[L."<<__LINE__<<"]\t"<<#__VA_ARGS__<<"=";dump(__VA_ARGS__);}while(0)
#else
#define dump(...)
#define debug(...)
#endif

template<class T, class Compare>inline void sort(T&a, Compare comp) { sort(a.begin(), a.end(), comp); }
template<class T>inline void sort(T&a) { sort(a.begin(), a.end()); }
template<class T>inline void rsort(T&a) { sort(a.rbegin(), a.rend()); }
template<class T>inline void reverse(T&a) { reverse(a.begin(), a.end()); }
template<class T>inline bool next_permutation(T&a) { return next_permutation(a.begin(), a.end()); }
template<class T, class U>inline bool binary_search(T&a, const U&v) { return binary_search(a.begin(), a.end(), v); }
template<class T, class U>inline auto lower_bound(T&a, const U&v) { return lower_bound(a.begin(), a.end(), v); }
template<class T, class U>inline auto upper_bound(T&a, const U&v) { return upper_bound(a.begin(), a.end(), v); }
template<class T>inline T Sum(vector<T>&a){return accumulate(a.begin(), a.end(), (T)0);}
template<class T>inline T max(vector<T>&a){return *max_element(a.begin(), a.end());}
template<class T>inline T min(vector<T>&a){return *min_element(a.begin(), a.end());}

template<class T,class U>inline bool chmax(T&a,const U&b){return(b>a)?(a=b,true):false;}
template<class T,class U>inline bool chmin(T&a,const U&b){return(b<a)?(a=b,true):false;}

ll gcd(const ll a, const ll b){return b ? gcd(b, a % b) : a;}
ll lcm(const ll a, const ll b){return a / gcd(a, b) * b;}

class in {
  int n, m;
public:
  in() : n(0),m(0){}
  in(int n_) : n(n_),m(0){};
  in(int n_, int m_) : n(n_),m(m_){};
  template <class T> operator T() {assert(n==0); assert(m==0); T ret; cin >> ret; return ret; }
  template <class T> operator vector<T>() {assert(n>0); assert(m==0); vector<T> ret(n); for(int i=0;i<n;++i) cin>>ret[i]; return ret; }
  template <class T> operator vector<vector<T>>() {assert(n>0); assert(m>0); vector<vector<T>> ret(n, vector<T>(m)); for(int i=0;i<n;++i) for(int j=0;j<m;++j) cin>>ret[i][j]; return ret; }
};

template<class T> void print(const T& a){ cout << a; }
int out(){ cout<<'\n'; return 0; }
template<class T> int out(const T& t){ print(t); cout<<'\n'; return 0; }
template<class Head, class... Tail> int out(const Head& head, const Tail&... tail){ print(head); cout << " "; out(tail...); return 0; }

template<class T> vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Tail> auto make_vector(size_t a, Tail... tail){ return vector<decltype(make_vector<T>(tail...))>(a, make_vector<T>(tail...)); }
#define Vector make_vector<ll>

template <std::uint_fast64_t Mod> class Modular {
  using u64 = std::uint_fast64_t;
public:
  u64 a;
  constexpr Modular(const u64 x = 0) noexcept : a(x % Mod) {}
  constexpr u64 val() const noexcept { return a; }
  constexpr Modular operator+(const Modular rhs) const noexcept { return Modular(*this) += rhs; }
  constexpr Modular operator-(const Modular rhs) const noexcept { return Modular(*this) -= rhs; }
  constexpr Modular operator*(const Modular rhs) const noexcept { return Modular(*this) *= rhs; }
  constexpr Modular operator/(const Modular rhs) const noexcept { return Modular(*this) /= rhs; }
  constexpr bool operator==(const Modular rhs) const noexcept { return Modular(*this).val() == rhs.val(); }
  Modular &operator+=(const Modular rhs) noexcept { a += rhs.a; if (a >= Mod) a -= Mod; return *this; }
  Modular &operator-=(const Modular rhs) noexcept { if (a < rhs.a) a += Mod; a -= rhs.a; return *this; }
  Modular &operator++() noexcept { return *this += 1; }
  Modular &operator--() noexcept { return *this -= 1; }
  Modular &operator*=(const Modular rhs) noexcept { a = a * rhs.a % Mod; return *this; }
  Modular &operator/=(Modular rhs) noexcept { u64 exp = Mod - 2; while(exp){ if(exp % 2) *this *= rhs; rhs *= rhs; exp /= 2; } return *this; }
};
template <std::uint_fast64_t Mod> ostream& operator<<(ostream& os, const Modular<Mod>& m){ return os << m.a; }

const double pi=acos(-1);
const double eps = 1e-9;
const ll inf = 1001001001;
const ll mod=(ll)1e9+7;
using mint = Modular<mod>;
//}}}

int main(){
  string S = in();
  bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
  puts(ans ? "YES" : "NO");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:117:25: error: no matching function for call to 'regex_match(std::string&, std::__cxx11::smatch, std::__cxx11::regex)'
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:2:
/usr/include/c++/14/bits/regex.h:2337:5: note: candidate: 'bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&, __cxx11::match_results<typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type) [with _Ch_traits = char_traits<char>; _Ch_alloc = allocator<char>; _Alloc = allocator<__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> > > >; _Ch_type = char; _Rx_traits = __cxx11::regex_traits<char>; typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator = __cxx11::basic_string<char>::const_iterator]' (near match)
 2337 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2337:5: note:   conversion of argument 2 would be ill-formed:
a.cc:117:29: error: cannot bind non-const lvalue reference of type 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >&' to an rvalue of type 'std::__cxx11::smatch' {aka 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >'}
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |                             ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2351:5: note: candidate: 'bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&&, __cxx11::match_results<typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type) [with _Ch_traits = char_traits<char>; _Ch_alloc = allocator<char>; _Alloc = allocator<__cxx11::sub_match<__gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> > > >; _Ch_type = char; _Rx_traits = __cxx11::regex_traits<char>; typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator = __cxx11::basic_string<char>::const_iterator]' (near match)
 2351 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&&,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2351:5: note:   conversion of argument 2 would be ill-formed:
a.cc:117:29: error: cannot bind non-const lvalue reference of type 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >&' to an rvalue of type 'std::__cxx11::smatch' {aka 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >'}
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |                             ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2261:5: note: candidate: 'template<class _Bi_iter, class _Alloc, class _Ch_type, class _Rx_traits> bool std::regex_match(_Bi_iter, _Bi_iter, __cxx11::match_results<_BiIter, _Alloc>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type)'
 2261 |     regex_match(_Bi_iter                                 __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2261:5: note:   candidate expects 4 arguments, 3 provided
/usr/include/c++/14/bits/regex.h:2288:5: note: candidate: 'template<class _Bi_iter, class _Ch_type, class _Rx_traits> bool std::regex_match(_Bi_iter, _Bi_iter, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2288 |     regex_match(_Bi_iter __first, _Bi_iter __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2288:5: note:   template argument deduction/substitution failed:
a.cc:117:25: note:   deduced conflicting types for parameter '_Bi_iter' ('std::__cxx11::basic_string<char>' and 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >')
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2313:5: note: candidate: 'template<class _Ch_type, class _Alloc, class _Rx_traits> bool std::regex_match(const _Ch_type*, __cxx11::match_results<const _Ch_type*, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2313 |     regex_match(const _Ch_type* __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2313:5: note:   template argument deduction/substitution failed:
a.cc:117:25: note:   mismatched types 'const _Ch_type*' and 'std::__cxx11::basic_string<char>'
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2373:5: note: candidate: 'template<class _Ch_type, class _Rx_traits> bool std::regex_match(const _Ch_type*, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2373 |     regex_match(const _Ch_type* __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2373:5: note:   template argument deduction/substitution failed:
a.cc:117:25: note:   mismatched types 'const _Ch_type*' and 'std::__cxx11::basic_string<char>'
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2395:5: note: candidate: 'template<class _Ch_traits, class _Str_allocator, class _Ch_type, class _Rx_traits> bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Str_allocator>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type)'
 2395 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Str_allocator>& __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2395:5: note:   template argument deduction/substitution failed:
a.cc:117:25: note:   'std::__cxx11::smatch' {aka 'std::__cxx11::match_results<__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> > >'} is not derived from 'const std::__cxx11::basic_regex<_CharT, _TraitsT>'
  117 |   bool ans = regex_match(S, smatch(), regex("A?KIHA?BA?RA?"));
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~