{$O-,Q+,R+,S+}
program synonym_MiXa;

Uses
	SysUtils;
    
Var
	s1, s2, ans: string;
    l: integer;
    log: array of string;

Procedure Init();
Begin
	readln(s1);
    readln(s2);
    s1 := s1 + '2';
    s2 := s2 + '3';
    l := length(s1);
End;

Function FindDiffIndex(): integer;
Begin
    Result := 1;
    while s1[Result] = s2[Result] do
    	Inc(Result);
End;

Procedure Swap(q, w: integer);
Var
	i: integer;
    c: char;
Begin
	For i := q to (q + w) div 2 do Begin
    	c := s1[i];
        s1[i] := s1[w + q - i];
        s1[w + q - i] := c;
    End;
End;

Procedure Solve();
Var
	i, n, s: integer;
Begin
   	ans := 'NO';
	if (length(s1) <> length(s2)) then Begin
        exit;
    End;
    n := FindDiffIndex();
    while (n < l) do Begin
		i := n;
        s := 0;
        while (i < l) do Begin
            s := (s + ord(s1[i]) - ord('0')) mod 2;
            if (s = 0) and (s1[i] <> s1[n]) then
                break;
            Inc(i);
        End;
        if (i < l) then Begin
        	Swap(n, i);
		    setlength(log, length(log)+1);
            log[length(log)-1] := IntToStr(n)+' '+IntToStr(i);
	    End else Begin
        	exit;
        End;
	    n := FindDiffIndex();
    End;
    ans := 'YES';
End;

Procedure Save();
Var
	i: integer;
Begin
	writeln(ans);
    if (ans = 'YES') then Begin
        writeln(length(log));
        For i := 0 to length(log)-1 do Begin
			writeln(log[i]);
        End;
    End;
End;

begin
    Init();
    Solve();
    Save();
end.