@tim's answer is excellent, but I'd like to address the question from a different angle.
This question's request for "earlier sources" is problematic. There were only two people present in the conversation, and they disagree. Any other claim of either verification or refutation is at best secondhand.
Since more direct evidence isn't available, it might be ...
Did Sanders say that a woman cannot be president or that that women in general lack the abilities?
While some headlines – including this question's title – claim that, this is not what Warren accused Sanders of:
Sanders responded that he did not believe a woman could win.
This is not a claim regarding women's inherent abilities, but a claim about ...
I would like to present the same evidence as DavePhD's answer, but with a different summary of what it indicates.
NYC recognises 3 genders on Birth Certificates (M, F, and X)
The number 31 probably comes from a list of gender-related terms which are not "legally recognised genders"
There may be contexts where more than 3 options are recognised ...
There is an official document on an official New York City website, which is a publication of the New York City Commission on Human Rights:
BILL DE BLASIO, Mayor • CARMELYN P. MALALIS, Commissioner/Chair
The document is titled, according to the URL, "Gender ID Card 2015".
The document lists the following 31 descriptors:
It is not stated that ...