A theoretical quest for graphene nanoribbons: effects of nitrogen substitution on the ground state alteration