ternary check