#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--){ int N,M; cin >> N >> M; vector> S(M); map Ts; for(int i=0; i> a; S.at(i) = {-1,a}; } for(auto &[t,s] : S) cin >> t,Ts[t]++; sort(S.begin(),S.end()); int ng = 0; for(int i=1; i s2) ng = 1; if(t == t2 && (s != t || s2 != t2)) ng = 1; } if(ng) cout << "No\n"; else cout << "Yes\n"; } }