if Y.shape[1] == cols and (set(Y.reshape(-1)) == set([0,1]) or \
            set(Y.reshape(-1)) == set([0.,1.])):