How did Avenged Sevenfold get their name?

The band was formed in 1999 in Huntington Beach, California with original members M. Shadows, Zacky Vengeance, The Rev and Matt Wendt. M Shadows came up with the name as a reference to the story of Cain and Abel from The Bible, which can be found in Genesis 4:24, although they are not a religious band.