n,e[28],s[7],b;C(d,i){for(i=s[d]?s[d]=0,n:0;i--;e[i]%10-d||C(e[i]/10))e[i]/10-d||C(e[i]%10);}main(i,d){for(;~scanf("%d",&n);b=!puts(!b&&d<3&&d-1?"Yes":"No")){for(i=n;i--;e[i]=d)scanf("%d",&d),b^=1<<d/10^1<<d%10,s[d/10]=s[d%10]=1;C(*e/10);for(d=0;b;d++)b&=b-1;for(i=7;i--;s[i]=0)b|=s[i];}}