class Utils {

    public static boolean anyIdCollides( long[] first, int firstLength, long[] other, int otherLength )
    {
        int f = 0;
        int o = 0;
        while ( f < firstLength && o < otherLength )
        {
            if ( first[f] == other[o] )
            {
                return true;
            }

            if ( first[f] < other[o] )
            {
                while ( ++f < firstLength && first[f] < other[o] )
                {
                }
            }
            else
            {
                while ( ++o < otherLength && first[f] > other[o] )
                {
                }
            }
        }

        return false;
    }

    private  Utils();

}