Dynamical symmetry breaking in two flavor SU(N) and SO(N) lattice gauge theories