JavaScript (ES6), 142 ... 122 121 bytes
Expects an array of characters, e.g. ['5','1','2']
. Returns 0 or 1.
a=>a.map(n=>D=D.map((_,i)=>D['504405076067'[d*6+i>>1]^i],p+=[w=a.length,-w,1,-1][d=D.indexOf(n)]),p=0,D=[...'254316'])|!p