Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	ll a = in(), b = in();
	string s; cin >> s;
	string head = s.substr(0, a), foot = s.substr(a + 1);
	cout << (all_of(ALL(head), isdigit) && s[a] == '-' && all_of(ALL(foot), isdigit) ? "Yes" : "No") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   30 |         cout << (all_of(ALL(head), isdigit) && s[a] == '-' && all_of(ALL(foot), isdigit) ? "Yes" : "No") << endl;
      |                  ~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:30:24: note:   couldn't deduce template parameter '_Predicate'
   30 |         cout << (all_of(ALL(head), isdigit) && s[a] == '-' && all_of(ALL(foot), isdigit) ? "Yes" : "No") << endl;
      |                  ~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided
a.cc:30:69: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   30 |         cout << (all_of(ALL(head), isdigit) && s[a] == '-' && all_of(ALL(foot), isdigit) ? "Yes" : "No") << endl;
      |                                                               ~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:30:69: note:   couldn't deduce template parameter '_Predicate'
   30 |         cout << (all_of(ALL(head), isdigit) && s[a] == '-' && all_of(ALL(foot), isdigit) ? "Yes" : "No") << endl;
      |                                                               ~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided