Koszul property of a class of graded algebras with nonpure resolutions