Was M2 executive produced by a person 's spouse and written by a art director , director , and producer of M1
SELECT count(*) WHERE {
?x0 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses ?x1 .
?x1 a ns:people.person .
?x2 ns:film.director.film M1 .
?x2 ns:film.film_art_director.films_art_directed M1 .
?x2 ns:film.producer.film|ns:film.production_company.films M1 .
FILTER ( ?x0 != ?x1 ) .
M2 ns:film.film.executive_produced_by ?x0 .
M2 ns:film.film.written_by ?x2
}