Magnetic Structures and Spin States of NdBaCo2O5