The dual effect of social ties on COVID-19 spread in Japan