Ancient humans avoided inbreeding by networking