Does eating close to bedtime contribute to heartburn and discomfort during sleep?

Does eating close to bedtime contribute to heartburn and discomfort during sleep?