Observation of different spin behavior with temperature variation and Cr substitution in a multiferroic compound YMn2O5