var n:longint;
s:array[0..100000]of longint;
procedure try(i:longint);
var j:longint;
begin
s[1]:=0; s[2]:=1;
if i>=3 then
for j:=3 to i do
s[j]:=((j-1)mod 1206)*(s[j-1]+s[j-2])mod 1206;
end;
begin
assign(input,'put.in');reset(input);
assign(output,'put.out');rewrite(output);
readln(n);
if n<=1 then begin writeln('No Solution!'); halt; end;
try(n);
writeln(s[n]);
close(input);close(output);
end.