Would you go to jail if...

Would you go to jail if a friend killed a person, then asked you to help hide the body? If you felt your life was in danger if you didn't comply, and you immediately went to the police, would you still get in trouble as an accessory, even under duress?