ll@N,@M,i,j,a,b,c=0,C[2N]={};string E;unionFind u{'m',2N,1};rep(M)rd(i--,E,j--),b=E[2]<'=',u(i,j+N*b),u(i+N,j+N-N*b);rep(i,N){a=u(i),b=u(i+N);if(a==b)wt("No"),exit(0);if(!C[a])C[a]=1,C[b]=2;c+=C[a]<2;}if(2c