public boolean isSameTree(TreeNode p, TreeNode q) {
	    	TreeNode q2 = q;
			TreeNode p2 = p;
			if (p2 == null && q2 ==null) return true;
	    	if (p2 == null || q2 == null) return false;
	    	if (p2.val != q2.val) return false;
	    	if (!isSameTree(p2.left, q2.left)) return false;
	    	if (!isSameTree(p2.right, q2.right)) return false;
	        return true;
	    }