Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
using namespace std;
#define mp make_pair
#define pb push_back
#define re return
#define fi first
#define se second
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<string> vs;
typedef vector<vi> vvi;
int n;
map<string,bool>mp;
bool f=1;
char last;
string s;
int main() {
	cin>>n;
	cin>>s;
	mp[s]=1;
	last=s[s.size()-1];
	for(int i=0;i<n;i++){
		cin>>s;
		if(s[0]!=last)f=0;
		if(mp[s]==1)f=0;
		last=s[s.size()-1];
		mp[s]=1;
	}
	if(f)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: reference to 'make_pair' is ambiguous
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:35:9: note: in expansion of macro 'mp'
   35 |         mp[s]=1;
      |         ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:15:12: note:                 'std::map<std::__cxx11::basic_string<char>, bool> make_pair'
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:28:17: note: in expansion of macro 'mp'
   28 | map<string,bool>mp;
      |                 ^~
a.cc:15:12: error: reference to 'make_pair' is ambiguous
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:40:20: note: in expansion of macro 'mp'
   40 |                 if(mp[s]==1)f=0;
      |                    ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:15:12: note:                 'std::map<std::__cxx11::basic_string<char>, bool> make_pair'
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:28:17: note: in expansion of macro 'mp'
   28 | map<string,bool>mp;
      |                 ^~
a.cc:15:12: error: reference to 'make_pair' is ambiguous
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:42:17: note: in expansion of macro 'mp'
   42 |                 mp[s]=1;
      |                 ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidates are: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:15:12: note:                 'std::map<std::__cxx11::basic_string<char>, bool> make_pair'
   15 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:28:17: note: in expansion of macro 'mp'
   28 | map<string,bool>mp;
      |                 ^~