In multipotent endoderm cells, regulatory elements of liver-specific genes and pancreas-specific genes are `pre-patterned' with distinct chromatin marks; both the active H3K9acK14ac marks and the repressive H3K27me3 mark are enriched in the regulatory elements of pancreas-expressed genes (such as Pdx1), but they are low or undetectable in the regulatory elements of liver-expressed genes (such as Alb1, Afp and Ttr). In response to BMP signaling, SMAD4 recruits p300 to the regulatory elements of liver-expressed genes to stimulate histone acetylation and induce hepatic specification. Meanwhile, the PRC2 complex maintains the level of H3K27me3 in the regulatory elements of pancreas-expressed genes to prevent pancreas specification.