how to write this function in python? : i have a list ,for example ,like this jj = [[2,3],[3,4],[1,2],[4,7],[1,7]]
every element is [x,y], 
if element A and B in jj follow this: A[1]==B[0], then this 2 element will fuse into a single element C=[a[0],b[1]],so after that,the length of new jj reduced by one.
please write a program check if the input list jj after several times inner element fusion, is there same element exist in new jj? if yes, return True else return False.