That's pretty common in plants: https://en.wikipedia.org/wiki/Dioecy