Language: C++

#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}


signed main(void) {
	int a, b;
	string s;
	cin >> a >> b >> s;
	if (!all_of(s.cbegin(), s.cbegin()+a, isdigit)|| !all_of(s.cbegin()+a+1, s.cend(), isdigit) || s[a]!='-')
	{
		print("No");
	}
	else print("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:20: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::const_iterator, __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, <unresolved overloaded function type>)'
   40 |         if (!all_of(s.cbegin(), s.cbegin()+a, isdigit)|| !all_of(s.cbegin()+a+1, s.cend(), isdigit) || s[a]!='-')
      |              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:1:
/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:40:20: note:   couldn't deduce template parameter '_Predicate'
   40 |         if (!all_of(s.cbegin(), s.cbegin()+a, isdigit)|| !all_of(s.cbegin()+a+1, s.cend(), isdigit) || s[a]!='-')
      |              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:40:65: error: no matching function for call to 'all_of(__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char>::const_iterator, <unresolved overloaded function type>)'
   40 |         if (!all_of(s.cbegin(), s.cbegin()+a, isdigit)|| !all_of(s.cbegin()+a+1, s.cend(), isdigit) || s[a]!='-')
      |                                                           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:40:65: note:   couldn't deduce template parameter '_Predicate'
   40 |         if (!all_of(s.cbegin(), s.cbegin()+a, isdigit)|| !all_of(s.cbegin()+a+1, s.cend(), isdigit) || s[a]!='-')
      |                                                           ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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